LoginGate: show an error if the user is inactive.

master
Tom Hacohen 2020-03-31 16:09:55 +03:00
parent ed4ed86880
commit 0ce83defcc
1 changed files with 4 additions and 2 deletions

View File

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