LoginGate: show an error if the user is inactive.

master
Tom Hacohen 5 years ago
parent ed4ed86880
commit 0ce83defcc

@ -31,11 +31,13 @@ function EncryptionPart(props: { credentials: CredentialsDataRemote }) {
const credentials = props.credentials; const credentials = props.credentials;
React.useEffect(() => { React.useEffect(() => {
// FIXME: verify the error is a 404
store.dispatch<any>(fetchUserInfo(credentials, credentials.credentials.email)).then((fetchedUserInfo: Action<EteSync.UserInfo>) => { store.dispatch<any>(fetchUserInfo(credentials, credentials.credentials.email)).then((fetchedUserInfo: Action<EteSync.UserInfo>) => {
setUserInfo(fetchedUserInfo.payload); setUserInfo(fetchedUserInfo.payload);
}).catch(() => { }).catch((e: Error) => {
// Do nothing. // Do nothing.
if ((e instanceof EteSync.HTTPError) && (e.status !== 404)) {
setError(e);
}
}).finally(() => { }).finally(() => {
setFetched(true); setFetched(true);
}); });

Loading…
Cancel
Save