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 2019-11-28 15:38:59 +02:00
parent bc4cc87bbb
commit b4634abff4
2 changed files with 3 additions and 1 deletions

View File

@ -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);
});

View File

@ -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());
}
}