fix it again?

This commit is contained in:
MathMan05 2024-09-10 09:48:01 -05:00
parent ee9483f350
commit baa224ab91
2 changed files with 21 additions and 12 deletions

View file

@ -286,17 +286,22 @@ class InfiniteScroller {
}
}
async delete() {
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 };

View file

@ -277,17 +277,21 @@ class InfiniteScroller{
}
}
async delete():Promise<void>{
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};