diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2018-08-19 03:17:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-19 03:17:01 +0200 |
commit | 025fbb8285cdedf495d9e4d015db611b0c622cbb (patch) | |
tree | 3ea8aad569fbb8101cca8eea9e4aba4cff730860 /app/javascript/mastodon/actions/statuses.js | |
parent | f13afa1ee92ceb40ce2e44f6457bd6e75b80adb5 (diff) |
Show compose form on delete & redraft when in mobile layout (#8277)
Fix #8274
Diffstat (limited to 'app/javascript/mastodon/actions/statuses.js')
-rw-r--r-- | app/javascript/mastodon/actions/statuses.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/mastodon/actions/statuses.js b/app/javascript/mastodon/actions/statuses.js index 3e1e5f270..8d5e72bec 100644 --- a/app/javascript/mastodon/actions/statuses.js +++ b/app/javascript/mastodon/actions/statuses.js @@ -140,7 +140,7 @@ export function redraft(status) { }; }; -export function deleteStatus(id, withRedraft = false) { +export function deleteStatus(id, router, withRedraft = false) { return (dispatch, getState) => { const status = getState().getIn(['statuses', id]); @@ -153,6 +153,10 @@ export function deleteStatus(id, withRedraft = false) { if (withRedraft) { dispatch(redraft(status)); + + if (!getState().getIn(['compose', 'mounted'])) { + router.push('/statuses/new'); + } } }).catch(error => { dispatch(deleteStatusFail(id, error)); |