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() {
|
async delete() {
|
||||||
for (const thing of this.HTMLElements) {
|
if (this.div) {
|
||||||
await this.destroyFromID(thing[1]);
|
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 = [];
|
this.HTMLElements = [];
|
||||||
if (this.timeout) {
|
if (this.timeout) {
|
||||||
clearTimeout(this.timeout);
|
clearTimeout(this.timeout);
|
||||||
}
|
}
|
||||||
if (this.div) {
|
|
||||||
this.div.remove();
|
|
||||||
}
|
|
||||||
this.div = null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export { InfiniteScroller };
|
export { InfiniteScroller };
|
||||||
|
|
|
@ -277,17 +277,21 @@ class InfiniteScroller{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async delete():Promise<void>{
|
async delete():Promise<void>{
|
||||||
for(const thing of this.HTMLElements){
|
if(this.div){
|
||||||
await this.destroyFromID(thing[1]);
|
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=[];
|
this.HTMLElements=[];
|
||||||
if(this.timeout){
|
if(this.timeout){
|
||||||
clearTimeout(this.timeout);
|
clearTimeout(this.timeout);
|
||||||
}
|
}
|
||||||
if(this.div){
|
|
||||||
this.div.remove();
|
|
||||||
}
|
|
||||||
this.div=null;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export{InfiniteScroller};
|
export{InfiniteScroller};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue