ModalRouter: change dispatch map to object
Moving away from the function version to the object version. Trying to track down why the effect that closes the modal ran when the pathname did not change. My only guess is the unstable hideModal reference due to the function mapping. There is no customization needed, so the object version is preferred anyways. `doOpenModal` isn't used, so I just removed that.
This commit is contained in:
parent
5e3effc94d
commit
b5dd24ff56
1 changed files with 4 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
|||
import { connect } from 'react-redux';
|
||||
import { selectModal } from 'redux/selectors/app';
|
||||
import { doOpenModal, doHideModal } from 'redux/actions/app';
|
||||
import { doHideModal } from 'redux/actions/app';
|
||||
import { selectError } from 'redux/selectors/notifications'; // RENAME THIS 'selectNotificationError'
|
||||
import ModalRouter from './view';
|
||||
|
||||
|
@ -9,9 +9,8 @@ const select = (state, props) => ({
|
|||
error: selectError(state),
|
||||
});
|
||||
|
||||
const perform = (dispatch) => ({
|
||||
openModal: (props) => dispatch(doOpenModal(props)),
|
||||
hideModal: (props) => dispatch(doHideModal(props)),
|
||||
});
|
||||
const perform = {
|
||||
hideModal: doHideModal,
|
||||
};
|
||||
|
||||
export default connect(select, perform)(ModalRouter);
|
||||
|
|
Loading…
Reference in a new issue