From: ThibG Date: Fri, 28 Jun 2019 11:52:15 +0000 (+0200) Subject: [Glitch] Fix swiping columns on mobile sometimes failing X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=4d964398dede71a0512430d904951cff2c7f58c5;p=mastodon.git [Glitch] Fix swiping columns on mobile sometimes failing Port 072158ee973f8e09a0abd34a825d9bce038a5d68 to glitch-soc --- diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js index 3a188ca87..30097f064 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js @@ -112,6 +112,11 @@ export default class ColumnsArea extends ImmutablePureComponent { // React-router does this for us, but too late, feeling laggy. document.querySelector(currentLinkSelector).classList.remove('active'); document.querySelector(nextLinkSelector).classList.add('active'); + + if (!this.state.shouldAnimate && typeof this.pendingIndex === 'number') { + this.context.router.history.push(getLink(this.pendingIndex)); + this.pendingIndex = null; + } } handleAnimationEnd = () => { @@ -162,7 +167,6 @@ export default class ColumnsArea extends ImmutablePureComponent { const { shouldAnimate } = this.state; const columnIndex = getIndex(this.context.router.history.location.pathname); - this.pendingIndex = null; if (singleColumn) { const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : ;