bug fixes

This commit is contained in:
MathMan05 2024-09-09 19:46:23 -05:00
parent cd15064d3a
commit 9e830ae520
6 changed files with 34 additions and 4 deletions

View file

@ -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 (_) => {

View file

@ -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();

View file

@ -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");
}