]> cat aescling's git repositories - mastodon.git/commitdiff
Don't attach IntersectionObserver for wrapped statuses (#3883)
authorunarist <m.unarist@gmail.com>
Wed, 21 Jun 2017 04:47:36 +0000 (13:47 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 21 Jun 2017 04:47:36 +0000 (06:47 +0200)
(This patch has been merged as bugfix and reverted, but still valuable as
improvement)

Previously, we've attached IntersectionObserver twice for boosted statuses:
wrapper Status and wrapped Status. but wrapped Status don't need to manage
intersection and visibility by itself, because it's a part of wrapper Status.

app/javascript/mastodon/components/status.js

index 325aceb5b32bed84df6ccf50ad20cb118524be67..1363956cf435f570ef8c8c1472445359c64dea1f 100644 (file)
@@ -154,7 +154,10 @@ class Status extends ImmutablePureComponent {
   render () {
     let media = null;
     let statusAvatar;
-    const { status, account, ...other } = this.props;
+
+    // Exclude intersectionObserverWrapper from `other` variable
+    // because intersection is managed in here.
+    const { status, account, intersectionObserverWrapper, ...other } = this.props;
     const { isExpanded, isIntersecting, isHidden } = this.state;
 
     if (status === null) {