From 1501b142d23d8bf00f3cb48f15b9de0dc9413c91 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 2 Jun 2019 11:51:49 +0200 Subject: [PATCH] Fix expanding status from menu modal in glitch-soc Fixes #1085 --- .../flavours/glitch/components/status_action_bar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index 6d1f54c602..4c398fd194 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -151,8 +151,12 @@ export default class StatusActionBar extends ImmutablePureComponent { handleOpen = () => { let state = {...this.context.router.history.location.state}; - state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; - this.context.router.history.push(`/statuses/${this.props.status.get('id')}`, state); + if (state.mastodonModalOpen) { + this.context.router.history.replace(`/statuses/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 }); + } else { + state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; + this.context.router.history.push(`/statuses/${this.props.status.get('id')}`, state); + } } handleEmbed = () => {