about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-02-06 23:36:43 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-02-06 23:36:43 +0100
commitd09ce6d81b542705fcce8f5091d032471531c755 (patch)
treeed20879b7855875ca03e6782809f77c5e1110e0c
parente28fe2ef2639d06c0df8717216052720f1c3543f (diff)
Fix IntersectionObserverArticle not hiding some out-of-view items (#9982)
IntersectionObserverArticle is made to save on RAM by avoiding fully rendering
items that are far out of view. However, it did not work for items spawned
outside the intersection observer.
-rw-r--r--app/javascript/mastodon/components/intersection_observer_article.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/javascript/mastodon/components/intersection_observer_article.js b/app/javascript/mastodon/components/intersection_observer_article.js
index de2203a4b..e453730ba 100644
--- a/app/javascript/mastodon/components/intersection_observer_article.js
+++ b/app/javascript/mastodon/components/intersection_observer_article.js
@@ -65,7 +65,7 @@ export default class IntersectionObserverArticle extends React.Component {
   }
 
   updateStateAfterIntersection = (prevState) => {
-    if (prevState.isIntersecting && !this.entry.isIntersecting) {
+    if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {
       scheduleIdleTask(this.hideIfNotIntersecting);
     }
     return {