2021-12-04 22:20:24 -05:00
|
|
|
import { DOMAIN } from 'config';
|
2020-02-19 01:31:40 -05:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doSetDaemonSetting } from 'redux/actions/settings';
|
2022-04-03 10:14:18 -04:00
|
|
|
import { doSignOut } from 'redux/actions/app';
|
2021-10-07 23:47:39 -04:00
|
|
|
import * as DAEMON_SETTINGS from 'constants/daemon_settings';
|
2020-06-15 16:33:03 -04:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-01-25 12:35:54 -05:00
|
|
|
import { doAuthenticate } from 'redux/actions/user';
|
|
|
|
import { version as appVersion } from 'package.json';
|
|
|
|
|
2020-02-24 13:20:45 -05:00
|
|
|
import PrivacyAgreement from './view';
|
|
|
|
|
2021-10-07 23:47:39 -04:00
|
|
|
const select = (state) => ({
|
2020-02-24 13:20:45 -05:00
|
|
|
authenticated: selectUserVerifiedEmail(state),
|
|
|
|
});
|
2020-02-19 01:31:40 -05:00
|
|
|
|
2021-10-07 23:47:39 -04:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setShareDataInternal: (share) => dispatch(doSetDaemonSetting(DAEMON_SETTINGS.SHARE_USAGE_DATA, share)),
|
2020-02-24 13:20:45 -05:00
|
|
|
signOut: () => dispatch(doSignOut()),
|
2021-12-04 22:20:24 -05:00
|
|
|
authenticateIfSharingData: () =>
|
|
|
|
dispatch(doAuthenticate(appVersion, undefined, undefined, true, undefined, undefined, DOMAIN)),
|
2020-02-19 01:31:40 -05:00
|
|
|
});
|
|
|
|
|
2020-06-15 16:33:03 -04:00
|
|
|
export default connect(select, perform)(PrivacyAgreement);
|