quick fix for sync #4718

Merged
jessopb merged 1 commit from sync-quick-fix into master 2020-08-28 17:25:48 +02:00
2 changed files with 16 additions and 16 deletions

View file

@ -605,6 +605,7 @@ export function doGetAndPopulatePreferences() {
// @if TARGET='app'
const { settings } = savedPreferences.value;
if (settings) {
Object.entries(settings).forEach(([key, val]) => {
if (SDK_SYNC_KEYS.includes(key)) {
if (shouldSetSetting(key, val, daemonSettings[key])) {
@ -617,6 +618,7 @@ export function doGetAndPopulatePreferences() {
}
}
});
}
// @endif
}
}

View file

@ -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 selectedSettings = sharedPreferences ? getSubsetFromKeysArray(sharedPreferences, clientSyncKeys) : {};
const mergedClientSettings = { ...currentClientSettings, ...selectedSettings };
return Object.assign({}, state, { sharedPreferences, clientSettings: mergedClientSettings });
}
return Object.assign({}, state, { sharedPreferences, clientSettings: currentClientSettings });
const newSharedPreferences = sharedPreferences || {};
return Object.assign({}, state, { sharedPreferences: newSharedPreferences, clientSettings: mergedClientSettings });
};
reducers[LBRY_REDUX_ACTIONS.SAVE_CUSTOM_WALLET_SERVERS] = (state, action) => {