2019-01-22 19:29:45 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { selectEmailToVerify, selectUser } from 'redux/selectors/user';
|
2019-01-22 19:29:45 +01:00
|
|
|
import FirstRunEmailCollection from './view';
|
2021-10-08 05:47:39 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2019-01-22 19:29:45 +01:00
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const select = (state) => ({
|
2019-05-07 23:38:29 +02:00
|
|
|
emailCollectionAcknowledged: makeSelectClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED)(state),
|
2019-01-22 19:29:45 +01:00
|
|
|
email: selectEmailToVerify(state),
|
|
|
|
user: selectUser(state),
|
|
|
|
});
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => () => ({
|
2019-01-22 19:29:45 +01:00
|
|
|
acknowledgeEmail: () => {
|
|
|
|
dispatch(doSetClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED, true));
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2020-06-15 22:33:03 +02:00
|
|
|
export default connect(select, perform)(FirstRunEmailCollection);
|