commit: 94ad0706f514e25c58c0a8f3201f96c1d1ccbbd8
parent: bf8c2c43483650bc046a3b3dd114f1cdfa49d2b4
Author: unarist <m.unarist@gmail.com>
Date: Tue, 20 Jun 2017 11:12:51 +0900
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.
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git 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) {