Show compose form on delete & redraft when in mobile layout (#8277)
Fix #8274
This commit is contained in:
parent
f13afa1ee9
commit
025fbb8285
5 changed files with 15 additions and 11 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue