about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/components
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-04-15 22:23:05 +0200
committerThibG <thib@sitedethib.com>2019-04-17 18:40:40 +0200
commite3c1472040105651fe55158b741c7ba92c1a7332 (patch)
tree6464148676a8b91cb181835b851e2882448824af /app/javascript/flavours/glitch/features/ui/components
parent8d57c0e70ea76b2f482c0919fc815d40352ef477 (diff)
Shift+click on column Back button to return to last pinable column
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/components')
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/boost_modal.js4
-rw-r--r--app/javascript/flavours/glitch/features/ui/components/favourite_modal.js4
2 files changed, 6 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js
index 9652bcb2d..0a914dce2 100644
--- a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js
+++ b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js
@@ -40,7 +40,9 @@ export default class BoostModal extends ImmutablePureComponent {
     if (e.button === 0) {
       e.preventDefault();
       this.props.onClose();
-      this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`);
+      let state = {...this.context.router.history.location.state};
+      state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
+      this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`, state);
     }
   }
 
diff --git a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js
index 70722411d..e0037a15f 100644
--- a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js
+++ b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js
@@ -40,7 +40,9 @@ export default class FavouriteModal extends ImmutablePureComponent {
     if (e.button === 0) {
       e.preventDefault();
       this.props.onClose();
-      this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`);
+      let state = {...this.context.router.history.location.state};
+      state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
+      this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`, state);
     }
   }