diff options
author | unarist <m.unarist@gmail.com> | 2017-06-20 11:12:51 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-20 04:12:51 +0200 |
commit | 94ad0706f514e25c58c0a8f3201f96c1d1ccbbd8 (patch) | |
tree | 36feefd1153b039a3ac2909f5a9746780e4cfd2e | |
parent | bf8c2c43483650bc046a3b3dd114f1cdfa49d2b4 (diff) |
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.
-rw-r--r-- | app/javascript/mastodon/components/status.js | 5 |
1 files changed, 4 insertions, 1 deletions
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) { |