]> cat aescling's git repositories - mastodon.git/commitdiff
Fix replying from modal (#16516)
authorClaire <claire.github-309c@sitedethib.com>
Sat, 17 Jul 2021 15:06:52 +0000 (17:06 +0200)
committerGitHub <noreply@github.com>
Sat, 17 Jul 2021 15:06:52 +0000 (17:06 +0200)
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.

app/javascript/mastodon/components/modal_root.js

index 8c9409d0144bbb4f938daf88190bb8ae0b5956aa..755c46fd6b20e6a8aac308071023371995bdf12e 100644 (file)
@@ -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,