diff options
author | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-03-26 16:22:55 +0100 |
---|---|---|
committer | Benjamin Tissoires <benjamin.tissoires@redhat.com> | 2019-03-26 16:28:25 +0100 |
commit | e2d0faa539e287247ccd1208fe74705169749210 (patch) | |
tree | 7bb3a451aea457d56ac736dc8f955d23c06e15dd /client/components | |
parent | cbb6c82113782c1ef235668ffb3c708431f6b400 (diff) | |
download | wekan-e2d0faa539e287247ccd1208fe74705169749210.tar.gz wekan-e2d0faa539e287247ccd1208fe74705169749210.tar.bz2 wekan-e2d0faa539e287247ccd1208fe74705169749210.zip |
list: disconnect infinite-scroll observer to prevent memory leak
Diffstat (limited to 'client/components')
-rw-r--r-- | client/components/lists/listBody.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index 2e6591e2..112b6379 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -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); |