Skip to content

Commit e74b88a

Browse files
ClearlyClairehiyuki2578
authored andcommitted
Fix swiping columns on mobile sometimes failing (mastodon#11200)
Fixes mastodon#9779
1 parent 3fc3230 commit e74b88a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/javascript/mastodon/features/ui/components/columns_area.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ class ColumnsArea extends ImmutablePureComponent {
110110
// React-router does this for us, but too late, feeling laggy.
111111
document.querySelector(currentLinkSelector).classList.remove('active');
112112
document.querySelector(nextLinkSelector).classList.add('active');
113+
114+
if (!this.state.shouldAnimate && typeof this.pendingIndex === 'number') {
115+
this.context.router.history.push(getLink(this.pendingIndex));
116+
this.pendingIndex = null;
117+
}
113118
}
114119

115120
handleAnimationEnd = () => {
@@ -160,7 +165,6 @@ class ColumnsArea extends ImmutablePureComponent {
160165
const { shouldAnimate } = this.state;
161166

162167
const columnIndex = getIndex(this.context.router.history.location.pathname);
163-
this.pendingIndex = null;
164168

165169
if (singleColumn) {
166170
const floatingActionButton = shouldHideFAB(this.context.router.history.location.pathname) ? null : <Link key='floating-action-button' to='/statuses/new' className='floating-action-button' aria-label={intl.formatMessage(messages.publish)}><Icon id='pencil' /></Link>;

0 commit comments

Comments
 (0)