diff --git a/ui/redux/actions/app.js b/ui/redux/actions/app.js index 84f7ee1e6..7b9eeef0c 100644 --- a/ui/redux/actions/app.js +++ b/ui/redux/actions/app.js @@ -605,18 +605,20 @@ export function doGetAndPopulatePreferences() { // @if TARGET='app' const { settings } = savedPreferences.value; - Object.entries(settings).forEach(([key, val]) => { - if (SDK_SYNC_KEYS.includes(key)) { - if (shouldSetSetting(key, val, daemonSettings[key])) { - if (key === DAEMON_SETTINGS.LBRYUM_SERVERS) { - const servers = stringifyServerParam(val); - dispatch(doSetDaemonSetting(key, servers, true)); - } else { - dispatch(doSetDaemonSetting(key, val, true)); + if (settings) { + Object.entries(settings).forEach(([key, val]) => { + if (SDK_SYNC_KEYS.includes(key)) { + if (shouldSetSetting(key, val, daemonSettings[key])) { + if (key === DAEMON_SETTINGS.LBRYUM_SERVERS) { + const servers = stringifyServerParam(val); + dispatch(doSetDaemonSetting(key, servers, true)); + } else { + dispatch(doSetDaemonSetting(key, val, true)); + } } } - } - }); + }); + } // @endif } } diff --git a/ui/redux/reducers/settings.js b/ui/redux/reducers/settings.js index 7a100fd96..a59a4c79c 100644 --- a/ui/redux/reducers/settings.js +++ b/ui/redux/reducers/settings.js @@ -167,12 +167,10 @@ reducers[LBRY_REDUX_ACTIONS.USER_STATE_POPULATE] = (state, action) => { const { clientSettings: currentClientSettings } = state; const { settings: sharedPreferences } = action.data; - if (currentClientSettings[SETTINGS.ENABLE_SYNC]) { - const selectedSettings = getSubsetFromKeysArray(sharedPreferences, clientSyncKeys); - const mergedClientSettings = { ...currentClientSettings, ...selectedSettings }; - return Object.assign({}, state, { sharedPreferences, clientSettings: mergedClientSettings }); - } - return Object.assign({}, state, { sharedPreferences, clientSettings: currentClientSettings }); + const selectedSettings = sharedPreferences ? getSubsetFromKeysArray(sharedPreferences, clientSyncKeys) : {}; + const mergedClientSettings = { ...currentClientSettings, ...selectedSettings }; + const newSharedPreferences = sharedPreferences || {}; + return Object.assign({}, state, { sharedPreferences: newSharedPreferences, clientSettings: mergedClientSettings }); }; reducers[LBRY_REDUX_ACTIONS.SAVE_CUSTOM_WALLET_SERVERS] = (state, action) => {