mirror of
https://github.com/wekan/wekan.git
synced 2025-12-24 03:10:12 +01:00
list: disconnect infinite-scroll observer to prevent memory leak
This commit is contained in:
parent
cbb6c82113
commit
e2d0faa539
1 changed files with 6 additions and 2 deletions
|
|
@ -629,17 +629,21 @@ BlazeComponent.extendComponent({
|
||||||
threshold: 0.25,
|
threshold: 0.25,
|
||||||
};
|
};
|
||||||
|
|
||||||
const observer = new IntersectionObserver((entries) => {
|
this.observer = new IntersectionObserver((entries) => {
|
||||||
entries.forEach((entry) => {
|
entries.forEach((entry) => {
|
||||||
this.spinnerShown = entry.isIntersecting;
|
this.spinnerShown = entry.isIntersecting;
|
||||||
this.updateList();
|
this.updateList();
|
||||||
});
|
});
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
observer.observe(spinner);
|
this.observer.observe(spinner);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onDestroyed() {
|
||||||
|
this.observer.disconnect();
|
||||||
|
},
|
||||||
|
|
||||||
updateList() {
|
updateList() {
|
||||||
if (this.spinnerShown) {
|
if (this.spinnerShown) {
|
||||||
this.cardlimit.set(this.cardlimit.get() + InfiniteScrollIter);
|
this.cardlimit.set(this.cardlimit.get() + InfiniteScrollIter);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue