Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
Fix column swiping animation logic (mastodon#15301)
Browse files Browse the repository at this point in the history
From the start, swiping columns was highly unreliable because the logic
could change `ReactSwipeableViews`'s `animateTransitions` property
mid-swipe.

PR mastodon#11200 partially fixed this, but at the unintended cost of disabling the
swipe animation altogether.

This PR changes the logic behind `shouldAnimate` to only disable the swiping
animation at the end of a column change not initiated by `ReactSwipeableViews`.

Co-authored-by: Claire <[email protected]>
  • Loading branch information
ClearlyClaire and ClearlyClaire authored Dec 7, 2020
1 parent 9620ee9 commit 0b43732
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ class ColumnsArea extends ImmutablePureComponent {
}

componentWillReceiveProps() {
this.setState({ shouldAnimate: false });
if (typeof this.pendingIndex !== 'number' && this.lastIndex !== getIndex(this.context.router.history.location.pathname)) {
this.setState({ shouldAnimate: false });
}
}

componentDidMount() {
Expand Down

0 comments on commit 0b43732

Please sign in to comment.