about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/status/components/detailed_status.js
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/status/components/detailed_status.js
parent8d57c0e70ea76b2f482c0919fc815d40352ef477 (diff)
Shift+click on column Back button to return to last pinable column
Diffstat (limited to 'app/javascript/flavours/glitch/features/status/components/detailed_status.js')
-rw-r--r--app/javascript/flavours/glitch/features/status/components/detailed_status.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
index e9130b1b0..69b646427 100644
--- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js
+++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js
@@ -42,7 +42,9 @@ export default class DetailedStatus extends ImmutablePureComponent {
   handleAccountClick = (e) => {
     if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) {
       e.preventDefault();
-      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);
     }
 
     e.stopPropagation();
@@ -51,7 +53,9 @@ export default class DetailedStatus extends ImmutablePureComponent {
   parseClick = (e, destination) => {
     if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) {
       e.preventDefault();
-      this.context.router.history.push(destination);
+      let state = {...this.context.router.history.location.state};
+      state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;
+      this.context.router.history.push(destination, state);
     }
 
     e.stopPropagation();