don't delete saved-password on preference_get fail

This commit is contained in:
Sean Yesmunt 2020-11-13 14:42:32 -05:00
parent abacafb0c5
commit 49a7dfd76d

View file

@ -52,7 +52,7 @@ import { doSyncSubscribe, doSetPrefsReady } from 'redux/actions/sync';
import { doAuthenticate } from 'redux/actions/user'; import { doAuthenticate } from 'redux/actions/user';
import { lbrySettings as config, version as appVersion } from 'package.json'; import { lbrySettings as config, version as appVersion } from 'package.json';
import analytics, { SHARE_INTERNAL } from 'analytics'; import analytics, { SHARE_INTERNAL } from 'analytics';
import { doSignOutCleanup, deleteSavedPassword } from 'util/saved-passwords'; import { doSignOutCleanup } from 'util/saved-passwords';
import { doSocketConnect } from 'redux/actions/websocket'; import { doSocketConnect } from 'redux/actions/websocket';
import { stringifyServerParam, shouldSetSetting } from 'util/sync-settings'; import { stringifyServerParam, shouldSetSetting } from 'util/sync-settings';
import sha256 from 'crypto-js/sha256'; import sha256 from 'crypto-js/sha256';
@ -646,18 +646,17 @@ export function doGetAndPopulatePreferences() {
} }
function failCb() { function failCb() {
deleteSavedPassword().then(() => { dispatch(
dispatch( doToast({
doToast({ isError: true,
isError: true, message: __('Unable to load your saved preferences.'),
message: __('Unable to load your saved preferences.'), })
}) );
);
dispatch({ dispatch({
type: ACTIONS.SYNC_FATAL_ERROR, type: ACTIONS.SYNC_FATAL_ERROR,
});
}); });
return false; return false;
} }