password error handling

This commit is contained in:
jessop 2020-09-18 13:26:00 -04:00 committed by Sean Yesmunt
parent 9127266956
commit ee1a37a806
5 changed files with 9 additions and 20 deletions

View file

@ -137,7 +137,7 @@
"json-loader": "^0.5.4", "json-loader": "^0.5.4",
"lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-format": "https://github.com/lbryio/lbry-format.git",
"lbry-redux": "lbryio/lbry-redux#e10295b5ec2ef42426755ed9fd50bd250b0d76dd", "lbry-redux": "lbryio/lbry-redux#e10295b5ec2ef42426755ed9fd50bd250b0d76dd",
"lbryinc": "lbryio/lbryinc#9440717a00d2fbb2e3226aaa2388f4698f324be2", "lbryinc": "lbryio/lbryinc#48347494230c6d1610cfd1c0bef23924e7428288",
"lint-staged": "^7.0.2", "lint-staged": "^7.0.2",
"localforage": "^1.7.1", "localforage": "^1.7.1",
"lodash-es": "^4.17.14", "lodash-es": "^4.17.14",

View file

@ -6,7 +6,7 @@ import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/se
import { selectUnclaimedRewards } from 'redux/selectors/rewards'; import { selectUnclaimedRewards } from 'redux/selectors/rewards';
import { doFetchChannelListMine, SETTINGS } from 'lbry-redux'; import { doFetchChannelListMine, SETTINGS } from 'lbry-redux';
import { makeSelectClientSetting, selectLoadedLanguages, selectThemePath } from 'redux/selectors/settings'; import { makeSelectClientSetting, selectLoadedLanguages, selectThemePath } from 'redux/selectors/settings';
import { selectIsUpgradeAvailable, selectAutoUpdateDownloaded } from 'redux/selectors/app'; import { selectIsUpgradeAvailable, selectAutoUpdateDownloaded, selectModal } from 'redux/selectors/app';
import { doGetWalletSyncPreference, doSetLanguage } from 'redux/actions/settings'; import { doGetWalletSyncPreference, doSetLanguage } from 'redux/actions/settings';
import { doSyncSubscribe } from 'redux/actions/syncwrapper'; import { doSyncSubscribe } from 'redux/actions/syncwrapper';
import { import {
@ -30,6 +30,7 @@ const select = state => ({
uploadCount: selectUploadCount(state), uploadCount: selectUploadCount(state),
rewards: selectUnclaimedRewards(state), rewards: selectUnclaimedRewards(state),
isAuthenticated: selectUserVerifiedEmail(state), isAuthenticated: selectUserVerifiedEmail(state),
currentModal: selectModal(state),
}); });
const perform = dispatch => ({ const perform = dispatch => ({

View file

@ -79,6 +79,7 @@ type Props = {
socketConnect: () => void, socketConnect: () => void,
syncSubscribe: () => void, syncSubscribe: () => void,
syncEnabled: boolean, syncEnabled: boolean,
currentModal: any,
}; };
function App(props: Props) { function App(props: Props) {
@ -103,6 +104,7 @@ function App(props: Props) {
setReferrer, setReferrer,
isAuthenticated, isAuthenticated,
syncSubscribe, syncSubscribe,
currentModal,
} = props; } = props;
const appRef = useRef(); const appRef = useRef();
@ -262,7 +264,7 @@ function App(props: Props) {
}, [user, setReadyForPrefs]); }, [user, setReadyForPrefs]);
useEffect(() => { useEffect(() => {
if (syncError && isAuthenticated && !pathname.includes(PAGES.AUTH_WALLET_PASSWORD)) { if (syncError && isAuthenticated && !pathname.includes(PAGES.AUTH_WALLET_PASSWORD) && !currentModal) {
history.push(`/$/${PAGES.AUTH_WALLET_PASSWORD}?redirect=${pathname}`); history.push(`/$/${PAGES.AUTH_WALLET_PASSWORD}?redirect=${pathname}`);
} }
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps

View file

@ -1,5 +1,4 @@
// @flow // @flow
import * as PAGES from 'constants/pages';
import * as MODALS from 'constants/modal_types'; import * as MODALS from 'constants/modal_types';
import React from 'react'; import React from 'react';
import Button from 'component/button'; import Button from 'component/button';
@ -18,20 +17,7 @@ type Props = {
}; };
function SyncToggle(props: Props) { function SyncToggle(props: Props) {
const { const { verifiedEmail, openModal, syncEnabled, disabled } = props;
verifiedEmail,
getSyncError,
history,
location: { pathname },
openModal,
syncEnabled,
disabled,
} = props;
if (getSyncError) {
history.push(`/$/${PAGES.AUTH}?redirect=${pathname}&immediate=true`);
return null;
}
return ( return (
<div> <div>

View file

@ -6419,9 +6419,9 @@ lbry-redux@lbryio/lbry-redux#e10295b5ec2ef42426755ed9fd50bd250b0d76dd:
reselect "^3.0.0" reselect "^3.0.0"
uuid "^3.3.2" uuid "^3.3.2"
lbryinc@lbryio/lbryinc#9440717a00d2fbb2e3226aaa2388f4698f324be2: lbryinc@lbryio/lbryinc#48347494230c6d1610cfd1c0bef23924e7428288:
version "0.0.1" version "0.0.1"
resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/9440717a00d2fbb2e3226aaa2388f4698f324be2" resolved "https://codeload.github.com/lbryio/lbryinc/tar.gz/48347494230c6d1610cfd1c0bef23924e7428288"
dependencies: dependencies:
reselect "^3.0.0" reselect "^3.0.0"