On mobile, go back in browser history upon posting, unless threaded mode is enabled

This commit is contained in:
Thibaut Girka authored and ThibG committed 2018-12-14 23:56:53 +01:00
1 parent 35b2ba5030
commit f0505a5b2e
2 files changed
+17 -7

No files matched your search

@@ -116,7 +116,7 @@ export function directCompose(account, router) {
};
};
export function submitCompose() {
export function submitCompose(routerHistory) {
return function (dispatch, getState) {
let status = getState().getIn(['compose', 'text'], '');
let media = getState().getIn(['compose', 'media_attachments']);
@@ -158,6 +158,12 @@ export function submitCompose() {
}
};
if (routerHistory && routerHistory.location.pathname === '/statuses/new'
&& window.history.state
&& !getState().getIn(['compose', 'advanced_options', 'threaded_mode'])) {
routerHistory.goBack();
}
insertIfOnline('home');
if (response.data.in_reply_to_id === null && response.data.visibility === 'public') {