lbry-desktop/ui/component/privacyAgreement/index.js

25 lines
1.1 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { doSetDaemonSetting } from 'redux/actions/settings';
import { doSetWelcomeVersion, doToggle3PAnalytics, doSignOut } from 'redux/actions/app';
import { DAEMON_SETTINGS } from 'lbry-redux';
import { WELCOME_VERSION } from 'config.js';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { doAuthenticate } from 'redux/actions/user';
import { version as appVersion } from 'package.json';
import PrivacyAgreement from './view';
2021-09-27 05:06:34 +02:00
const select = (state) => ({
authenticated: selectUserVerifiedEmail(state),
});
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)),
signOut: () => dispatch(doSignOut()),
2021-09-27 05:06:34 +02:00
authenticateIfSharingData: () => dispatch(doAuthenticate(appVersion, undefined, undefined, true)), // appVersion, shareData?, shareCallback, callInstall
});
export default connect(select, perform)(PrivacyAgreement);