]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fix column swiping animation logic
authorThibG <thib@sitedethib.com>
Mon, 7 Dec 2020 19:07:24 +0000 (20:07 +0100)
committerClaire <claire.github-309c@sitedethib.com>
Wed, 9 Dec 2020 14:12:28 +0000 (15:12 +0100)
Port 0b437325dc93a1d28202b5ff30eaafc9b4e571b7 to glitch-soc

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/features/ui/components/columns_area.js

index 5c2e387a5f29c42f963f3362b567845b44134948..640be19aba078db3fb552f39944954572942b0e1 100644 (file)
@@ -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() {