From fbb3aa154cb5ab73bd5d4505edcdd36f6759c4c2 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 12 Nov 2019 22:31:45 +0200 Subject: [PATCH] Login Form: fix new user detection following promise middleware changes. --- src/LoginGate.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LoginGate.tsx b/src/LoginGate.tsx index dec5a65..03f6cc5 100644 --- a/src/LoginGate.tsx +++ b/src/LoginGate.tsx @@ -22,8 +22,9 @@ function EncryptionPart(props: { credentials: CredentialsType, onEncryptionFormS const credentials = props.credentials.value!; React.useEffect(() => { - store.dispatch(fetchUserInfo(credentials, credentials.credentials.email)).then((userInfo: any) => { - setIsNewUser(userInfo.error); + // FIXME: verify the error is a 404 + store.dispatch(fetchUserInfo(credentials, credentials.credentials.email)).catch(() => { + setIsNewUser(true); }).finally(() => { setFetched(true); });