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:
infinite-persistence 2022-05-18 18:20:55 +08:00
parent 5e3effc94d
commit b5dd24ff56
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -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);