remember channels you were in last
This commit is contained in:
parent
b5e0e6df8b
commit
7915032462
6 changed files with 10 additions and 5 deletions
|
@ -676,6 +676,8 @@ class Channel extends SnowFlake {
|
|||
this.myhtml.classList.add("viewChannel");
|
||||
}
|
||||
this.guild.prevchannel = this;
|
||||
this.guild.perminfo.prevchannel = this.id;
|
||||
this.localuser.userinfo.updateLocal();
|
||||
this.localuser.channelfocus = this;
|
||||
const prom = this.infinite.delete();
|
||||
history.pushState(null, "", "/channels/" + this.guild_id + "/" + this.id);
|
||||
|
|
|
@ -90,7 +90,6 @@ class Guild extends SnowFlake {
|
|||
this.properties = json.properties;
|
||||
this.roles = [];
|
||||
this.roleids = new Map();
|
||||
this.prevchannel = undefined;
|
||||
this.message_notifications = 0;
|
||||
for (const roley of json.roles) {
|
||||
const roleh = new Role(roley, this);
|
||||
|
@ -127,6 +126,7 @@ class Guild extends SnowFlake {
|
|||
this.headchannels.push(thing);
|
||||
}
|
||||
}
|
||||
this.prevchannel = this.channelids[this.perminfo.prevchannel];
|
||||
}
|
||||
get perminfo() {
|
||||
return this.localuser.perminfo.guilds[this.id];
|
||||
|
|
|
@ -97,7 +97,7 @@ class InfiniteScroller {
|
|||
snapBottom() {
|
||||
const scrollBottom = this.scrollBottom;
|
||||
return () => {
|
||||
if (this.scroll && scrollBottom < 30) {
|
||||
if (this.scroll && scrollBottom < 10) {
|
||||
this.scroll.scrollTop = this.scroll.scrollHeight + 20;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -686,6 +686,8 @@ class Channel extends SnowFlake{
|
|||
this.myhtml.classList.add("viewChannel");
|
||||
}
|
||||
this.guild.prevchannel=this;
|
||||
this.guild.perminfo.prevchannel=this.id;
|
||||
this.localuser.userinfo.updateLocal();
|
||||
this.localuser.channelfocus=this;
|
||||
const prom=this.infinite.delete();
|
||||
history.pushState(null, "","/channels/"+this.guild_id+"/"+this.id);
|
||||
|
|
|
@ -9,7 +9,7 @@ import{Permissions}from"./permissions.js";
|
|||
import{ SnowFlake }from"./snowflake.js";
|
||||
import{ channeljson, guildjson, emojijson, memberjson }from"./jsontypes.js";
|
||||
import{ User }from"./user.js";
|
||||
import{ Message }from"./message.js";
|
||||
|
||||
class Guild extends SnowFlake{
|
||||
owner:Localuser;
|
||||
headers:Localuser["headers"];
|
||||
|
@ -100,7 +100,7 @@ class Guild extends SnowFlake{
|
|||
this.properties=json.properties;
|
||||
this.roles=[];
|
||||
this.roleids=new Map();
|
||||
this.prevchannel=undefined;
|
||||
|
||||
this.message_notifications=0;
|
||||
for(const roley of json.roles){
|
||||
const roleh=new Role(roley,this);
|
||||
|
@ -135,6 +135,7 @@ class Guild extends SnowFlake{
|
|||
this.headchannels.push(thing);
|
||||
}
|
||||
}
|
||||
this.prevchannel=this.channelids[this.perminfo.prevchannel];
|
||||
}
|
||||
get perminfo(){
|
||||
return this.localuser.perminfo.guilds[this.id];
|
||||
|
|
|
@ -97,7 +97,7 @@ class InfiniteScroller{
|
|||
snapBottom(){
|
||||
const scrollBottom=this.scrollBottom;
|
||||
return()=>{
|
||||
if(this.scroll&&scrollBottom<30){
|
||||
if(this.scroll&&scrollBottom<10){
|
||||
this.scroll.scrollTop=this.scroll.scrollHeight+20;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue