Merge pull request #3725 from lbryio/syncBug

sync bug
This commit is contained in:
jessopb 2020-02-21 16:03:16 -05:00 committed by GitHub
commit 0f57f894b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,6 +34,7 @@ import {
selectModal, selectModal,
selectAllowAnalytics, selectAllowAnalytics,
} from 'redux/selectors/app'; } from 'redux/selectors/app';
import { selectDaemonSettings } from 'redux/selectors/settings';
import { doAuthenticate, doGetSync } from 'lbryinc'; import { doAuthenticate, doGetSync } from 'lbryinc';
import { lbrySettings as config, version as appVersion } from 'package.json'; import { lbrySettings as config, version as appVersion } from 'package.json';
import analytics from 'analytics'; import analytics from 'analytics';
@ -477,7 +478,7 @@ export function doGetAndPopulatePreferences() {
return (dispatch, getState) => { return (dispatch, getState) => {
function successCb(savedPreferences) { function successCb(savedPreferences) {
const state = getState(); const state = getState();
const { daemonSettings } = state; const daemonSettings = selectDaemonSettings(state);
if (savedPreferences !== null) { if (savedPreferences !== null) {
dispatch(doPopulateSharedUserState(savedPreferences)); dispatch(doPopulateSharedUserState(savedPreferences));
@ -485,7 +486,7 @@ export function doGetAndPopulatePreferences() {
const { settings, sharing_3P: sharing3P } = savedPreferences.value; const { settings, sharing_3P: sharing3P } = savedPreferences.value;
Object.entries(settings).forEach(([key, val]) => { Object.entries(settings).forEach(([key, val]) => {
if (daemonSettings[key] !== val) { if (daemonSettings[key] !== val) {
dispatch(doSetDaemonSetting(key, val, false)); dispatch(doSetDaemonSetting(key, val, true));
} }
}); });
if (sharing3P !== undefined) { if (sharing3P !== undefined) {