restore to enable_sync in client settings

This commit is contained in:
jessop 2020-09-17 21:03:41 -04:00
parent f287775d62
commit 8a737de116
2 changed files with 5 additions and 2 deletions

2
dist/bundle.es.js vendored
View file

@ -1815,7 +1815,7 @@ const buildSharedStateMiddleware = (actions, sharedStateFilters, sharedStateCb)
const actionResult = next(action);
// Call `getState` after calling `next` to ensure the state has updated in response to the action
const nextState = getState();
const syncEnabled = nextState.settings && nextState.settings.syncEnabledInWallet;
const syncEnabled = nextState.settings && nextState.settings.clientSettings && nextState.settings.clientSettings.enable_sync;
const hasVerifiedEmail = nextState.user && nextState.user.user && nextState.user.user.has_verified_email;
const preferenceKey = syncEnabled && hasVerifiedEmail ? 'shared' : 'local';
const shared = {};

View file

@ -26,7 +26,10 @@ export const buildSharedStateMiddleware = (
const actionResult = next(action);
// Call `getState` after calling `next` to ensure the state has updated in response to the action
const nextState: { user: any, settings: any } = getState();
const syncEnabled = nextState.settings && nextState.settings.syncEnabledInWallet;
const syncEnabled =
nextState.settings &&
nextState.settings.clientSettings &&
nextState.settings.clientSettings.enable_sync;
const hasVerifiedEmail =
nextState.user && nextState.user.user && nextState.user.user.has_verified_email;
const preferenceKey = syncEnabled && hasVerifiedEmail ? 'shared' : 'local';