bug fixes
This commit is contained in:
parent
cd15064d3a
commit
9e830ae520
6 changed files with 34 additions and 4 deletions
|
@ -342,13 +342,16 @@ class Channel extends SnowFlake {
|
|||
}
|
||||
static dragged = [];
|
||||
html;
|
||||
get visable() {
|
||||
return this.hasPermission("VIEW_CHANNEL");
|
||||
}
|
||||
createguildHTML(admin = false) {
|
||||
const div = document.createElement("div");
|
||||
this.html = new WeakRef(div);
|
||||
if (!this.hasPermission("VIEW_CHANNEL")) {
|
||||
if (!this.visable) {
|
||||
let quit = true;
|
||||
for (const thing of this.children) {
|
||||
if (thing.hasPermission("VIEW_CHANNEL")) {
|
||||
if (thing.visable) {
|
||||
quit = false;
|
||||
}
|
||||
}
|
||||
|
@ -651,6 +654,7 @@ class Channel extends SnowFlake {
|
|||
const id = ++Channel.genid;
|
||||
if (this.localuser.channelfocus) {
|
||||
this.localuser.channelfocus.infinite.delete();
|
||||
this.localuser.channelfocus = this;
|
||||
}
|
||||
if (this.guild !== this.localuser.lookingguild) {
|
||||
this.guild.loadGuild();
|
||||
|
@ -922,6 +926,9 @@ class Channel extends SnowFlake {
|
|||
else if (removetitle) {
|
||||
removetitle.remove();
|
||||
}
|
||||
if (this.localuser.channelfocus !== this) {
|
||||
return;
|
||||
}
|
||||
messages.append(await this.infinite.getDiv(id));
|
||||
this.infinite.updatestuff();
|
||||
this.infinite.watchForChange().then(async (_) => {
|
||||
|
|
|
@ -152,6 +152,7 @@ class Group extends Channel {
|
|||
const id = ++Channel.genid;
|
||||
if (this.localuser.channelfocus) {
|
||||
this.localuser.channelfocus.infinite.delete();
|
||||
this.localuser.channelfocus = this;
|
||||
}
|
||||
if (this.guild !== this.localuser.lookingguild) {
|
||||
this.guild.loadGuild();
|
||||
|
|
|
@ -532,6 +532,13 @@ class Localuser {
|
|||
if (!guild) {
|
||||
guild = this.guildids.get("@me");
|
||||
}
|
||||
if (this.lookingguild === guild) {
|
||||
return guild;
|
||||
}
|
||||
if (this.channelfocus) {
|
||||
this.channelfocus.infinite.delete();
|
||||
this.channelfocus = undefined;
|
||||
}
|
||||
if (this.lookingguild) {
|
||||
this.lookingguild.html.classList.remove("serveropen");
|
||||
}
|
||||
|
|
|
@ -355,13 +355,16 @@ class Channel extends SnowFlake{
|
|||
}
|
||||
static dragged:[Channel,HTMLDivElement]|[]=[];
|
||||
html:WeakRef<HTMLElement>|undefined;
|
||||
get visable(){
|
||||
return this.hasPermission("VIEW_CHANNEL")
|
||||
}
|
||||
createguildHTML(admin=false):HTMLDivElement{
|
||||
const div=document.createElement("div");
|
||||
this.html=new WeakRef(div);
|
||||
if(!this.hasPermission("VIEW_CHANNEL")){
|
||||
if(!this.visable){
|
||||
let quit=true;
|
||||
for(const thing of this.children){
|
||||
if(thing.hasPermission("VIEW_CHANNEL")){
|
||||
if(thing.visable){
|
||||
quit=false;
|
||||
}
|
||||
}
|
||||
|
@ -662,6 +665,7 @@ class Channel extends SnowFlake{
|
|||
const id=++Channel.genid;
|
||||
if(this.localuser.channelfocus){
|
||||
this.localuser.channelfocus.infinite.delete();
|
||||
this.localuser.channelfocus=this;
|
||||
}
|
||||
if(this.guild!==this.localuser.lookingguild){
|
||||
this.guild.loadGuild();
|
||||
|
@ -927,6 +931,9 @@ class Channel extends SnowFlake{
|
|||
}else if(removetitle){
|
||||
removetitle.remove();
|
||||
}
|
||||
if(this.localuser.channelfocus!==this){
|
||||
return;
|
||||
}
|
||||
messages.append(await this.infinite.getDiv(id));
|
||||
this.infinite.updatestuff();
|
||||
this.infinite.watchForChange().then(async _=>{
|
||||
|
|
|
@ -161,6 +161,7 @@ class Group extends Channel{
|
|||
const id=++Channel.genid;
|
||||
if(this.localuser.channelfocus){
|
||||
this.localuser.channelfocus.infinite.delete();
|
||||
this.localuser.channelfocus=this;
|
||||
}
|
||||
if(this.guild!==this.localuser.lookingguild){
|
||||
this.guild.loadGuild();
|
||||
|
|
|
@ -520,6 +520,13 @@ class Localuser{
|
|||
if(!guild){
|
||||
guild=this.guildids.get("@me");
|
||||
}
|
||||
if(this.lookingguild===guild){
|
||||
return guild;
|
||||
}
|
||||
if(this.channelfocus){
|
||||
this.channelfocus.infinite.delete();
|
||||
this.channelfocus=undefined;
|
||||
}
|
||||
if(this.lookingguild){
|
||||
this.lookingguild.html.classList.remove("serveropen");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue