[Glitch] Show compose form on delete & redraft when in mobile layout

Port 025fbb8285 to glitch-soc
This commit is contained in:
Thibaut Girka
2018-08-31 16:41:58 +02:00
committed by ThibG
parent 0f1db47a7e
commit 130bdb5ee8
5 changed files with 15 additions and 11 deletions

View File

@ -79,7 +79,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]);
@ -91,6 +91,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));