hopefully reduce double channel bug further

This commit is contained in:
MathMan05
2026-05-10 15:01:49 -05:00
parent 09a809004c
commit eedffa0ad5
+7 -1
View File
@@ -2772,6 +2772,7 @@ class Channel extends SnowFlake {
(document.getElementById("typebox") as HTMLDivElement).blur();
}
if (getMessages) await this.putmessages();
await prom;
if (id !== Channel.genid) {
return;
@@ -3112,6 +3113,7 @@ class Channel extends SnowFlake {
}
infinitefocus = false;
async tryfocusinfinate(id: string | void, flash = false) {
const gid = ++Channel.genid;
if (typeof id === "string" && !this.messages.has(id)) await this.getmessage(id);
if (this.infinitefocus) return;
this.infinitefocus = true;
@@ -3153,7 +3155,11 @@ class Channel extends SnowFlake {
elm.remove();
console.warn("rouge element detected and removed");
}
messages.append(await this.infinite.getDiv(id, flash));
const div = await this.infinite.getDiv(id, flash);
if (gid !== Channel.genid) {
return;
}
messages.append(div);
/*
await this.infinite.watchForChange().then(async (_) => {
//await new Promise(resolve => setTimeout(resolve, 0));