fix it again?
This commit is contained in:
parent
ee9483f350
commit
baa224ab91
2 changed files with 21 additions and 12 deletions
|
@ -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 };
|
||||
|
|
|
@ -277,17 +277,21 @@ class InfiniteScroller{
|
|||
}
|
||||
}
|
||||
async delete():Promise<void>{
|
||||
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};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue