From 0ce83defcce2c29ca25238dfa461368bc3873994 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 31 Mar 2020 16:09:55 +0300 Subject: [PATCH] LoginGate: show an error if the user is inactive. --- src/LoginGate.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LoginGate.tsx b/src/LoginGate.tsx index 03f0222..9758138 100644 --- a/src/LoginGate.tsx +++ b/src/LoginGate.tsx @@ -31,11 +31,13 @@ function EncryptionPart(props: { credentials: CredentialsDataRemote }) { const credentials = props.credentials; React.useEffect(() => { - // FIXME: verify the error is a 404 store.dispatch(fetchUserInfo(credentials, credentials.credentials.email)).then((fetchedUserInfo: Action) => { setUserInfo(fetchedUserInfo.payload); - }).catch(() => { + }).catch((e: Error) => { // Do nothing. + if ((e instanceof EteSync.HTTPError) && (e.status !== 404)) { + setError(e); + } }).finally(() => { setFetched(true); });