]> cat aescling's git repositories - mastodon.git/commitdiff
[Glitch] Fixed WebUI crash when a status opened in the media modal is deleted
authorkaias1jp <kaias1jp@gmail.com>
Thu, 11 Feb 2021 18:59:47 +0000 (03:59 +0900)
committerClaire <claire.github-309c@sitedethib.com>
Fri, 12 Feb 2021 09:58:34 +0000 (10:58 +0100)
Port 08ae116dc62c51988e9710b4f0cc9fdb2e9557b9 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
app/javascript/flavours/glitch/reducers/modal.js

index 7bd9d4b326b883db93e379e4979d54c9d6d2d023..52b05d69be7d766351d1fc97818f7cd5a691b27c 100644 (file)
@@ -1,4 +1,5 @@
 import { MODAL_OPEN, MODAL_CLOSE } from 'flavours/glitch/actions/modal';
+import { TIMELINE_DELETE } from 'flavours/glitch/actions/timelines';
 
 const initialState = {
   modalType: null,
@@ -11,6 +12,8 @@ export default function modal(state = initialState, action) {
     return { modalType: action.modalType, modalProps: action.modalProps };
   case MODAL_CLOSE:
     return (action.modalType === undefined || action.modalType === state.modalType) ? initialState : state;
+  case TIMELINE_DELETE:
+    return (state.modalProps.statusId === action.id) ? initialState : state;
   default:
     return state;
   }