[Glitch] Fix reply button on media modal not giving focus to compose form
Port 2cd31b3177 to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
			
			
This commit is contained in:
		@@ -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 }));
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user