about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-07-17 17:06:52 +0200
committerGitHub <noreply@github.com>2021-07-17 17:06:52 +0200
commite54a65013d200cc8407dc4d3cf6631846062f813 (patch)
treeb296572fbe71cdb8ae77f78e315ee3365884ca0c
parent211d5c3c300b5a54b60c7b0142158144f9b0d392 (diff)
Fix replying from modal (#16516)
Fixes #16515

Not using a router object somehow made `this.history` lag behind the real
browser history whenever pushing a new history item in `replyCompose`.

Not using the context-provided router in this case was an oversight made
when porting glitch-soc changes in #16499.
-rw-r--r--app/javascript/mastodon/components/modal_root.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/mastodon/components/modal_root.js b/app/javascript/mastodon/components/modal_root.js
index 8c9409d01..755c46fd6 100644
--- a/app/javascript/mastodon/components/modal_root.js
+++ b/app/javascript/mastodon/components/modal_root.js
@@ -6,6 +6,10 @@ import { multiply } from 'color-blend';
 
 export default class ModalRoot extends React.PureComponent {
 
+  static contextTypes = {
+    router: PropTypes.object,
+  };
+
   static propTypes = {
     children: PropTypes.node,
     onClose: PropTypes.func.isRequired,