Browse Source

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.
closed-social-v3
unarist 7 years ago
committed by Eugen Rochko
parent
commit
94ad0706f5
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      app/javascript/mastodon/components/status.js

+ 4
- 1
app/javascript/mastodon/components/status.js View File

@ -154,7 +154,10 @@ class Status extends ImmutablePureComponent {
render () { render () {
let media = null; let media = null;
let statusAvatar; 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; const { isExpanded, isIntersecting, isHidden } = this.state;
if (status === null) { if (status === null) {

Loading…
Cancel
Save