diff options
author | alpaca-tc <alpaca-tc@alpaca.tc> | 2017-06-19 18:29:57 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-19 11:29:57 +0200 |
commit | cf6fe4f8cbafeb2f4e3a92bac4f3909cfc327edf (patch) | |
tree | edff310deff7accca16afb187b23ce6b92fb4ed8 /app/javascript/mastodon/features/ui/util | |
parent | 436744328726d5ba32a90dbdaf60e57272c788db (diff) |
Unobserve status on unmount (#3851)
Diffstat (limited to 'app/javascript/mastodon/features/ui/util')
-rw-r--r-- | app/javascript/mastodon/features/ui/util/intersection_observer_wrapper.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/javascript/mastodon/features/ui/util/intersection_observer_wrapper.js b/app/javascript/mastodon/features/ui/util/intersection_observer_wrapper.js index 0e959f9ae..b15f8b9ef 100644 --- a/app/javascript/mastodon/features/ui/util/intersection_observer_wrapper.js +++ b/app/javascript/mastodon/features/ui/util/intersection_observer_wrapper.js @@ -37,6 +37,13 @@ class IntersectionObserverWrapper { } } + unobserve (id, node) { + if (this.observer) { + delete this.callbacks[id]; + this.observer.unobserve(node); + } + } + disconnect () { if (this.observer) { this.observer.disconnect(); |