about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/actions/statuses.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-08-31 16:41:58 +0200
committerThibG <thib@sitedethib.com>2018-08-31 18:33:46 +0200
commit130bdb5ee8c0689a44b353be9bc0ca78b75bdf2e (patch)
tree4a707cba2bda5ce337b4a089968fc35784daa052 /app/javascript/flavours/glitch/actions/statuses.js
parent0f1db47a7e551bfc6a2f59d7f2def131bcb5b43c (diff)
[Glitch] Show compose form on delete & redraft when in mobile layout
Port 025fbb8285cdedf495d9e4d015db611b0c622cbb to glitch-soc
Diffstat (limited to 'app/javascript/flavours/glitch/actions/statuses.js')
-rw-r--r--app/javascript/flavours/glitch/actions/statuses.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/javascript/flavours/glitch/actions/statuses.js b/app/javascript/flavours/glitch/actions/statuses.js
index c6d8486f9..fa8845002 100644
--- a/app/javascript/flavours/glitch/actions/statuses.js
+++ b/app/javascript/flavours/glitch/actions/statuses.js
@@ -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));