This commit is contained in:
zeppi 2022-04-03 10:14:18 -04:00 committed by jessopb
parent ec600bb8c8
commit b47bd7e8b6
3 changed files with 3 additions and 19 deletions

View file

@ -16,7 +16,7 @@ COMMENT_SERVER_NAME=Odysee
SEARCH_SERVER_API=https://lighthouse.odysee.com/search
SOCKETY_SERVER_API=wss://sockety.odysee.com/ws
THUMBNAIL_CDN_URL=https://image-processor.vanwanet.com/optimize/
WELCOME_VERSION=1.3
WELCOME_VERSION=1.2
# STRIPE
# STRIPE_PUBLIC_KEY='pk_test_NoL1JWL7i1ipfhVId5KfDZgo'

View file

@ -1,9 +1,8 @@
import { DOMAIN } from 'config';
import { connect } from 'react-redux';
import { doSetDaemonSetting } from 'redux/actions/settings';
import { doSetWelcomeVersion, doToggle3PAnalytics, doSignOut } from 'redux/actions/app';
import { doSignOut } from 'redux/actions/app';
import * as DAEMON_SETTINGS from 'constants/daemon_settings';
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';
@ -15,9 +14,7 @@ const select = (state) => ({
});
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()),
authenticateIfSharingData: () =>
dispatch(doAuthenticate(appVersion, undefined, undefined, true, undefined, undefined, DOMAIN)),

View file

@ -12,42 +12,29 @@ const LIMITED = 'limited';
const NONE = 'none';
type Props = {
setWelcomeVersion: (number) => void,
signOut: () => void,
setShareDataInternal: (boolean) => void,
setShareDataThirdParty: (boolean) => void,
authenticated: boolean,
authenticateIfSharingData: () => void,
handleNextPage: () => void,
};
function PrivacyAgreement(props: Props) {
const {
setShareDataInternal,
setShareDataThirdParty,
authenticated,
signOut,
authenticateIfSharingData,
handleNextPage,
} = props;
const { setShareDataInternal, authenticated, signOut, authenticateIfSharingData, handleNextPage } = props;
const [share, setShare] = useState(undefined); // preload
function handleSubmit() {
if (share === LIMITED) {
setShareDataInternal(true);
setShareDataThirdParty(false);
} else {
setShareDataInternal(false);
setShareDataThirdParty(false);
}
if (share === LIMITED) {
authenticateIfSharingData();
}
// setWelcomeVersion(WELCOME_VERSION);
handleNextPage();
// history.replace(`/`);
}
return (