From baa224ab918184bf8cfcbba171c3e11963abdc18 Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Tue, 10 Sep 2024 09:48:01 -0500 Subject: [PATCH] fix it again? --- .dist/infiniteScroller.js | 17 +++++++++++------ webpage/infiniteScroller.ts | 16 ++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.dist/infiniteScroller.js b/.dist/infiniteScroller.js index c26b92f..3144019 100644 --- a/.dist/infiniteScroller.js +++ b/.dist/infiniteScroller.js @@ -286,17 +286,22 @@ class InfiniteScroller { } } async delete() { - for (const thing of this.HTMLElements) { - await this.destroyFromID(thing[1]); + if (this.div) { + this.div.remove(); + this.div = null; + } + try { + for (const thing of this.HTMLElements) { + await this.destroyFromID(thing[1]); + } + } + catch (e) { + console.error(e); } this.HTMLElements = []; if (this.timeout) { clearTimeout(this.timeout); } - if (this.div) { - this.div.remove(); - } - this.div = null; } } export { InfiniteScroller }; diff --git a/webpage/infiniteScroller.ts b/webpage/infiniteScroller.ts index 7a7988b..64339f5 100644 --- a/webpage/infiniteScroller.ts +++ b/webpage/infiniteScroller.ts @@ -277,17 +277,21 @@ class InfiniteScroller{ } } async delete():Promise{ - for(const thing of this.HTMLElements){ - await this.destroyFromID(thing[1]); + if(this.div){ + this.div.remove(); + this.div=null; + } + try{ + for(const thing of this.HTMLElements){ + await this.destroyFromID(thing[1]); + } + }catch(e){ + console.error(e); } this.HTMLElements=[]; if(this.timeout){ clearTimeout(this.timeout); } - if(this.div){ - this.div.remove(); - } - this.div=null; } } export{InfiniteScroller};