quick fix for sync #4718
2 changed files with 16 additions and 16 deletions
|
@ -605,18 +605,20 @@ export function doGetAndPopulatePreferences() {
|
||||||
// @if TARGET='app'
|
// @if TARGET='app'
|
||||||
|
|
||||||
const { settings } = savedPreferences.value;
|
const { settings } = savedPreferences.value;
|
||||||
Object.entries(settings).forEach(([key, val]) => {
|
if (settings) {
|
||||||
if (SDK_SYNC_KEYS.includes(key)) {
|
Object.entries(settings).forEach(([key, val]) => {
|
||||||
if (shouldSetSetting(key, val, daemonSettings[key])) {
|
if (SDK_SYNC_KEYS.includes(key)) {
|
||||||
if (key === DAEMON_SETTINGS.LBRYUM_SERVERS) {
|
if (shouldSetSetting(key, val, daemonSettings[key])) {
|
||||||
const servers = stringifyServerParam(val);
|
if (key === DAEMON_SETTINGS.LBRYUM_SERVERS) {
|
||||||
dispatch(doSetDaemonSetting(key, servers, true));
|
const servers = stringifyServerParam(val);
|
||||||
} else {
|
dispatch(doSetDaemonSetting(key, servers, true));
|
||||||
dispatch(doSetDaemonSetting(key, val, true));
|
} else {
|
||||||
|
dispatch(doSetDaemonSetting(key, val, true));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
// @endif
|
// @endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,12 +167,10 @@ reducers[LBRY_REDUX_ACTIONS.USER_STATE_POPULATE] = (state, action) => {
|
||||||
const { clientSettings: currentClientSettings } = state;
|
const { clientSettings: currentClientSettings } = state;
|
||||||
const { settings: sharedPreferences } = action.data;
|
const { settings: sharedPreferences } = action.data;
|
||||||
|
|
||||||
if (currentClientSettings[SETTINGS.ENABLE_SYNC]) {
|
const selectedSettings = sharedPreferences ? getSubsetFromKeysArray(sharedPreferences, clientSyncKeys) : {};
|
||||||
const selectedSettings = getSubsetFromKeysArray(sharedPreferences, clientSyncKeys);
|
const mergedClientSettings = { ...currentClientSettings, ...selectedSettings };
|
||||||
const mergedClientSettings = { ...currentClientSettings, ...selectedSettings };
|
const newSharedPreferences = sharedPreferences || {};
|
||||||
return Object.assign({}, state, { sharedPreferences, clientSettings: mergedClientSettings });
|
return Object.assign({}, state, { sharedPreferences: newSharedPreferences, clientSettings: mergedClientSettings });
|
||||||
}
|
|
||||||
return Object.assign({}, state, { sharedPreferences, clientSettings: currentClientSettings });
|
|
||||||
};
|
};
|
||||||
|
|
||||||
reducers[LBRY_REDUX_ACTIONS.SAVE_CUSTOM_WALLET_SERVERS] = (state, action) => {
|
reducers[LBRY_REDUX_ACTIONS.SAVE_CUSTOM_WALLET_SERVERS] = (state, action) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue