check usage data setting from localStorage since daemon settings won't be loaded yet

This commit is contained in:
Sean Yesmunt 2020-02-24 17:02:03 -05:00
parent 80972527c7
commit e9a1f48ab9
3 changed files with 8 additions and 6 deletions

View file

@ -984,5 +984,6 @@
"A copy of your wallet is synced to lbry.tv": "A copy of your wallet is synced to lbry.tv",
"Internal sharing is required while signed in.": "Internal sharing is required while signed in.",
"Your wallet is not currently synced with lbry.tv. You are in control of backing up your wallet.": "Your wallet is not currently synced with lbry.tv. You are in control of backing up your wallet.",
"FINAL WARNING: This action is permanent and cannot be undone.": "FINAL WARNING: This action is permanent and cannot be undone."
}
"FINAL WARNING: This action is permanent and cannot be undone.": "FINAL WARNING: This action is permanent and cannot be undone.",
"Allow the app to access third party analytics platforms": "Allow the app to access third party analytics platforms"
}

View file

@ -16,7 +16,7 @@ const LBRY_TV_UA_ID = 'UA-60403362-12';
const DESKTOP_UA_ID = 'UA-60403362-13';
const SECOND_TRACKER_NAME = 'tracker2';
const SHARE_INTERNAL = 'shareInternal';
export const SHARE_INTERNAL = 'shareInternal';
const SHARE_THIRD_PARTY = 'shareThirdParty';
// @if TARGET='app'

View file

@ -38,7 +38,7 @@ import {
import { selectDaemonSettings } from 'redux/selectors/settings';
import { doAuthenticate, doGetSync } from 'lbryinc';
import { lbrySettings as config, version as appVersion } from 'package.json';
import analytics from 'analytics';
import analytics, { SHARE_INTERNAL } from 'analytics';
import { doSignOutCleanup, deleteSavedPassword, getSavedPassword } from 'util/saved-passwords';
// @if TARGET='app'
@ -320,8 +320,9 @@ export function doAlertError(errorList) {
export function doDaemonReady() {
return (dispatch, getState) => {
const state = getState();
const daemonSettings = selectDaemonSettings(state);
const { share_usage_data: shareUsageData } = daemonSettings;
// TODO: call doFetchDaemonSettings, then get usage data, and call doAuthenticate once they are loaded into the store
const shareUsageData = window.localStorage.getItem(SHARE_INTERNAL) === 'true';
dispatch(doAuthenticate(appVersion, undefined, undefined, shareUsageData));
dispatch({ type: ACTIONS.DAEMON_READY });