lbry-desktop/ui/component/emailCollection/index.js
infinite-persistence 3c4ccdd2fe
Kill makeSelectClientSetting
## Why
- No memo required (no transformation).
- `makeSelect*` is an incorrect pattern.

## Changes
- Replaced makeSelectClientSetting with selectClientSetting.
- Remove unused selectShowRepostedContent.
2021-11-23 12:29:53 +08:00

20 lines
751 B
JavaScript

import { connect } from 'react-redux';
import { doSetClientSetting } from 'redux/actions/settings';
import { selectClientSetting } from 'redux/selectors/settings';
import { selectEmailToVerify, selectUser } from 'redux/selectors/user';
import FirstRunEmailCollection from './view';
import * as SETTINGS from 'constants/settings';
const select = (state) => ({
emailCollectionAcknowledged: selectClientSetting(state, SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED),
email: selectEmailToVerify(state),
user: selectUser(state),
});
const perform = (dispatch) => () => ({
acknowledgeEmail: () => {
dispatch(doSetClientSetting(SETTINGS.EMAIL_COLLECTION_ACKNOWLEDGED, true));
},
});
export default connect(select, perform)(FirstRunEmailCollection);