summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-03-26 16:22:55 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-03-26 16:28:25 +0100
commite2d0faa539e287247ccd1208fe74705169749210 (patch)
tree7bb3a451aea457d56ac736dc8f955d23c06e15dd
parentcbb6c82113782c1ef235668ffb3c708431f6b400 (diff)
downloadwekan-e2d0faa539e287247ccd1208fe74705169749210.tar.gz
wekan-e2d0faa539e287247ccd1208fe74705169749210.tar.bz2
wekan-e2d0faa539e287247ccd1208fe74705169749210.zip
list: disconnect infinite-scroll observer to prevent memory leak
-rw-r--r--client/components/lists/listBody.js8
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);