diff --git a/.dist/channel.js b/.dist/channel.js index b9b85ef..cfe082d 100644 --- a/.dist/channel.js +++ b/.dist/channel.js @@ -551,8 +551,8 @@ class Channel { for (const thing of response) { const message = new Message(thing, this); if (prev) { - this.idToNext.set(message.snowflake, prev.id); - this.idToPrev.set(prev.id, message.snowflake); + this.idToNext.set(message.snowflake, prev.snowflake); + this.idToPrev.set(prev.snowflake, message.snowflake); } else { this.lastmessage = message; diff --git a/.dist/markdown.js b/.dist/markdown.js index 1cd0b1e..f48e2ab 100644 --- a/.dist/markdown.js +++ b/.dist/markdown.js @@ -500,28 +500,25 @@ class MarkDown { restore(); } static gatherBoxText(element) { - const children = element.childNodes; if (element.tagName.toLowerCase() === "img") { return element.alt; } if (element.tagName.toLowerCase() === "br") { return "\n"; } - if (children.length !== 0) { - let build = ""; - for (const thing of children) { - if (thing instanceof Text) { - const text = thing.textContent; - build += text; - continue; - } - const text = this.gatherBoxText(thing); - if (text) { - build += text; - } + let build = ""; + for (const thing of element.childNodes) { + if (thing instanceof Text) { + const text = thing.textContent; + build += text; + continue; + } + const text = this.gatherBoxText(thing); + if (text) { + build += text; } - return build; } + return build; } } //solution from https://stackoverflow.com/questions/4576694/saving-and-restoring-caret-position-for-contenteditable-div diff --git a/webpage/channel.ts b/webpage/channel.ts index 60f2ba3..3eff6a0 100644 --- a/webpage/channel.ts +++ b/webpage/channel.ts @@ -557,12 +557,12 @@ class Channel{ if(response.length!==100){ this.allthewayup=true; } - let prev=undefined; + let prev:Message=undefined; for(const thing of response){ const message=new Message(thing,this); if(prev){ - this.idToNext.set(message.snowflake,prev.id); - this.idToPrev.set(prev.id,message.snowflake); + this.idToNext.set(message.snowflake,prev.snowflake); + this.idToPrev.set(prev.snowflake,message.snowflake); }else{ this.lastmessage=message; }