ui: add inuse error for signup

This commit is contained in:
nick-delirium 2025-03-21 15:50:21 +01:00
parent d04e6686ca
commit fe20f83130
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0

View file

@ -391,15 +391,16 @@ class UserStore {
this.signUpRequest = { loading: false, errors: [] };
});
} catch (error) {
const inUse = error.message.includes('already in use');
const inUseMsg = this.t('An account with this email already exists. Please log in or use a different email address.')
const genericMsg = this.t('Error signing up; please check your data and try again')
runInAction(() => {
this.signUpRequest = {
loading: false,
errors: error.response?.errors || [],
};
});
toast.error(
this.t('Error signing up; please check your data and try again'),
);
toast.error(inUse ? inUseMsg : genericMsg);
} finally {
runInAction(() => {
this.signUpRequest.loading = false;