about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/features/ui/containers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-25 00:51:01 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-02-26 09:54:48 +0100
commit8e04ba87b709365facbbe28682b2809225f209bc (patch)
treeef813144eaa86e7ee5b8527ea7fd74ac22817668 /app/javascript/flavours/glitch/features/ui/containers
parent2e2b8a9a40ecdd2a7a63ecccb252af46179bbdb5 (diff)
[Glitch] Fix reply button on media modal not giving focus to compose form
Port 2cd31b31778cec3b282a44f03a03844d92a4e8cc to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/javascript/flavours/glitch/features/ui/containers')
-rw-r--r--app/javascript/flavours/glitch/features/ui/containers/modal_container.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/javascript/flavours/glitch/features/ui/containers/modal_container.js b/app/javascript/flavours/glitch/features/ui/containers/modal_container.js
index 039aabd8a..560c34f01 100644
--- a/app/javascript/flavours/glitch/features/ui/containers/modal_container.js
+++ b/app/javascript/flavours/glitch/features/ui/containers/modal_container.js
@@ -3,22 +3,23 @@ import { openModal, closeModal } from 'flavours/glitch/actions/modal';
 import ModalRoot from '../components/modal_root';
 
 const mapStateToProps = state => ({
-  type: state.getIn(['modal', 0, 'modalType'], null),
-  props: state.getIn(['modal', 0, 'modalProps'], {}),
+  ignoreFocus: state.getIn(['modal', 'ignoreFocus']),
+  type: state.getIn(['modal', 'stack', 0, 'modalType'], null),
+  props: state.getIn(['modal', 'stack', 0, 'modalProps'], {}),
 });
 
 const mapDispatchToProps = dispatch => ({
-  onClose (confirmationMessage) {
+  onClose (confirmationMessage, ignoreFocus = false) {
     if (confirmationMessage) {
       dispatch(
         openModal('CONFIRM', {
           message: confirmationMessage.message,
           confirm: confirmationMessage.confirm,
-          onConfirm: () => dispatch(closeModal()),
+          onConfirm: () => dispatch(closeModal(undefined, { ignoreFocus })),
         }),
       );
     } else {
-      dispatch(closeModal());
+      dispatch(closeModal(undefined, { ignoreFocus }));
     }
   },
 });