Fix new account setup.

We were getting a 404 because the user info doesn't exist, and were erroring
because of it, which was not calling the then (just the catch).

We now handle the error condition.
master
Tom Hacohen 5 years ago
parent bc4cc87bbb
commit b4634abff4

@ -29,6 +29,8 @@ function EncryptionPart(props: { credentials: CredentialsType }) {
// FIXME: verify the error is a 404
store.dispatch<any>(fetchUserInfo(credentials, credentials.credentials.email)).then((fetchedUserInfo: Action<EteSync.UserInfo>) => {
setUserInfo(fetchedUserInfo.payload);
}).catch(() => {
// Do nothing.
}).finally(() => {
setFetched(true);
});

@ -146,7 +146,7 @@ class SyncGate extends React.PureComponent<PropsTypeInner> {
syncAll();
} else {
const fetching = store.dispatch(fetchUserInfo(this.props.etesync, me)) as any;
fetching.then(sync);
fetching.then(sync).catch(() => sync());
}
}

Loading…
Cancel
Save