]> cat aescling's git repositories - mastodon.git/commitdiff
Fix expanding status from menu modal in glitch-soc
authorThibaut Girka <thib@sitedethib.com>
Sun, 2 Jun 2019 09:51:49 +0000 (11:51 +0200)
committerThibG <thib@sitedethib.com>
Sun, 2 Jun 2019 12:11:32 +0000 (14:11 +0200)
Fixes #1085

app/javascript/flavours/glitch/components/status_action_bar.js

index 6d1f54c602aba07853ecfbb22e3b059cdbd9d423..4c398fd194017553509a1f86abaac2bf73d4cc25 100644 (file)
@@ -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 = () => {