Login Form: fix new user detection following promise middleware changes.

master
Tom Hacohen 5 years ago
parent 7edb1abfb4
commit fbb3aa154c

@ -22,8 +22,9 @@ function EncryptionPart(props: { credentials: CredentialsType, onEncryptionFormS
const credentials = props.credentials.value!;
React.useEffect(() => {
store.dispatch<any>(fetchUserInfo(credentials, credentials.credentials.email)).then((userInfo: any) => {
setIsNewUser(userInfo.error);
// FIXME: verify the error is a 404
store.dispatch<any>(fetchUserInfo(credentials, credentials.credentials.email)).catch(() => {
setIsNewUser(true);
}).finally(() => {
setFetched(true);
});

Loading…
Cancel
Save