2020-02-19 07:31:40 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doSetDaemonSetting } from 'redux/actions/settings';
|
2020-02-24 19:20:45 +01:00
|
|
|
import { doSetWelcomeVersion, doToggle3PAnalytics, doSignOut } from 'redux/actions/app';
|
2020-02-19 07:31:40 +01:00
|
|
|
import { DAEMON_SETTINGS } from 'lbry-redux';
|
|
|
|
import { WELCOME_VERSION } from 'config.js';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-01-25 18:35:54 +01:00
|
|
|
import { doAuthenticate } from 'redux/actions/user';
|
|
|
|
import { version as appVersion } from 'package.json';
|
|
|
|
|
2020-02-24 19:20:45 +01:00
|
|
|
import PrivacyAgreement from './view';
|
|
|
|
|
2021-09-27 05:06:34 +02:00
|
|
|
const select = (state) => ({
|
2020-02-24 19:20:45 +01:00
|
|
|
authenticated: selectUserVerifiedEmail(state),
|
|
|
|
});
|
2020-02-19 07:31:40 +01:00
|
|
|
|
2021-09-27 05:06:34 +02:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setWelcomeVersion: (version) => dispatch(doSetWelcomeVersion(version || WELCOME_VERSION)),
|
|
|
|
setShareDataInternal: (share) => dispatch(doSetDaemonSetting(DAEMON_SETTINGS.SHARE_USAGE_DATA, share)),
|
|
|
|
setShareDataThirdParty: (share) => dispatch(doToggle3PAnalytics(share)),
|
2020-02-24 19:20:45 +01:00
|
|
|
signOut: () => dispatch(doSignOut()),
|
2021-09-27 05:06:34 +02:00
|
|
|
authenticateIfSharingData: () => dispatch(doAuthenticate(appVersion, undefined, undefined, true)), // appVersion, shareData?, shareCallback, callInstall
|
2020-02-19 07:31:40 +01:00
|
|
|
});
|
|
|
|
|
2020-06-15 22:33:03 +02:00
|
|
|
export default connect(select, perform)(PrivacyAgreement);
|