From ee1a37a8068d287f6564b6aae1f65a753637e9d2 Mon Sep 17 00:00:00 2001 From: jessop Date: Fri, 18 Sep 2020 13:26:00 -0400 Subject: [PATCH] password error handling --- package.json | 2 +- ui/component/app/index.js | 3 ++- ui/component/app/view.jsx | 4 +++- ui/component/syncToggle/view.jsx | 16 +--------------- yarn.lock | 4 ++-- 5 files changed, 9 insertions(+), 20 deletions(-) diff --git a/package.json b/package.json index 49c1f6def..4223ea551 100644 --- a/package.json +++ b/package.json @@ -137,7 +137,7 @@ "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-redux": "lbryio/lbry-redux#e10295b5ec2ef42426755ed9fd50bd250b0d76dd", - "lbryinc": "lbryio/lbryinc#9440717a00d2fbb2e3226aaa2388f4698f324be2", + "lbryinc": "lbryio/lbryinc#48347494230c6d1610cfd1c0bef23924e7428288", "lint-staged": "^7.0.2", "localforage": "^1.7.1", "lodash-es": "^4.17.14", diff --git a/ui/component/app/index.js b/ui/component/app/index.js index 19850d29e..d3db0fe1e 100644 --- a/ui/component/app/index.js +++ b/ui/component/app/index.js @@ -6,7 +6,7 @@ import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/se import { selectUnclaimedRewards } from 'redux/selectors/rewards'; import { doFetchChannelListMine, SETTINGS } from 'lbry-redux'; 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 { doSyncSubscribe } from 'redux/actions/syncwrapper'; import { @@ -30,6 +30,7 @@ const select = state => ({ uploadCount: selectUploadCount(state), rewards: selectUnclaimedRewards(state), isAuthenticated: selectUserVerifiedEmail(state), + currentModal: selectModal(state), }); const perform = dispatch => ({ diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index 91478c3d9..80e7d5e75 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -79,6 +79,7 @@ type Props = { socketConnect: () => void, syncSubscribe: () => void, syncEnabled: boolean, + currentModal: any, }; function App(props: Props) { @@ -103,6 +104,7 @@ function App(props: Props) { setReferrer, isAuthenticated, syncSubscribe, + currentModal, } = props; const appRef = useRef(); @@ -262,7 +264,7 @@ function App(props: Props) { }, [user, setReadyForPrefs]); 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}`); } // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/ui/component/syncToggle/view.jsx b/ui/component/syncToggle/view.jsx index 1f85c0278..2a885ecf3 100644 --- a/ui/component/syncToggle/view.jsx +++ b/ui/component/syncToggle/view.jsx @@ -1,5 +1,4 @@ // @flow -import * as PAGES from 'constants/pages'; import * as MODALS from 'constants/modal_types'; import React from 'react'; import Button from 'component/button'; @@ -18,20 +17,7 @@ type Props = { }; function SyncToggle(props: Props) { - const { - verifiedEmail, - getSyncError, - history, - location: { pathname }, - openModal, - syncEnabled, - disabled, - } = props; - - if (getSyncError) { - history.push(`/$/${PAGES.AUTH}?redirect=${pathname}&immediate=true`); - return null; - } + const { verifiedEmail, openModal, syncEnabled, disabled } = props; return (
diff --git a/yarn.lock b/yarn.lock index b8252a4a3..7ce3461ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6419,9 +6419,9 @@ lbry-redux@lbryio/lbry-redux#e10295b5ec2ef42426755ed9fd50bd250b0d76dd: reselect "^3.0.0" uuid "^3.3.2" -lbryinc@lbryio/lbryinc#9440717a00d2fbb2e3226aaa2388f4698f324be2: +lbryinc@lbryio/lbryinc#48347494230c6d1610cfd1c0bef23924e7428288: 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: reselect "^3.0.0"