logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: cc382c5006ed5c4c18c3547150b214807b217c7b
parent: 946a166791e5a1a10778e15ca4a9f5f10c961134
Author: unarist <m.unarist@gmail.com>
Date:   Wed, 21 Jun 2017 13:47:36 +0900

Don't attach IntersectionObserver for wrapped statuses (#3883)

(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.

Diffstat:

Mapp/javascript/mastodon/components/status.js5++++-
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) {