From 94ad0706f514e25c58c0a8f3201f96c1d1ccbbd8 Mon Sep 17 00:00:00 2001 From: unarist Date: Tue, 20 Jun 2017 11:12:51 +0900 Subject: [PATCH] Don't attach IntersectionObserver for wrapped statuses (#3863) This fixes a bug that sometimes boosted statuses being hidden on scrolling. Previously, we've attached IntersectionObserver twice for boosted statuses: wrapper Status and wrapped Status. This will call intersection handler twice, so this may results race condition...probably. --- app/javascript/mastodon/components/status.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 3b8f88bf7..17f2eb9d3 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -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) {