From: unarist Date: Tue, 20 Jun 2017 02:12:51 +0000 (+0900) Subject: Don't attach IntersectionObserver for wrapped statuses (#3863) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=94ad0706f514e25c58c0a8f3201f96c1d1ccbbd8;p=mastodon.git 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. --- 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) {