]> cat aescling's git repositories - mastodon.git/commitdiff
When posting in mobile mode, go back to previous history location (#9502)
authorThibG <thib@sitedethib.com>
Fri, 14 Dec 2018 19:35:26 +0000 (20:35 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 14 Dec 2018 19:35:26 +0000 (20:35 +0100)
Fixes #7112

app/javascript/mastodon/actions/compose.js

index 86d83122fc1aaab536f26aa8d7d81d202f9732a1..1c7f14b5ef7f3656666411d3cd1b27fd4e85e20d 100644 (file)
@@ -144,7 +144,11 @@ export function submitCompose(routerHistory) {
 
       if (response.data.visibility === 'direct' && getState().getIn(['conversations', 'mounted']) <= 0 && routerHistory) {
         routerHistory.push('/timelines/direct');
-      } else if (response.data.visibility !== 'direct') {
+      } else if (routerHistory && routerHistory.location.pathname === '/statuses/new' && window.history.state) {
+        routerHistory.goBack();
+      }
+
+      if (response.data.visibility !== 'direct') {
         insertIfOnline('home');
       }