mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 15:30:13 +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,
|
||||
};
|
||||
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
this.observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
this.spinnerShown = entry.isIntersecting;
|
||||
this.updateList();
|
||||
});
|
||||
}, options);
|
||||
|
||||
observer.observe(spinner);
|
||||
this.observer.observe(spinner);
|
||||
}
|
||||
},
|
||||
|
||||
onDestroyed() {
|
||||
this.observer.disconnect();
|
||||
},
|
||||
|
||||
updateList() {
|
||||
if (this.spinnerShown) {
|
||||
this.cardlimit.set(this.cardlimit.get() + InfiniteScrollIter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue