From fe20f83130f4bfae1d406c4d239eefb9dbc87f7f Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Fri, 21 Mar 2025 15:50:21 +0100 Subject: [PATCH] ui: add inuse error for signup --- frontend/app/mstore/userStore.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/app/mstore/userStore.ts b/frontend/app/mstore/userStore.ts index f29fcd325..1010b8361 100644 --- a/frontend/app/mstore/userStore.ts +++ b/frontend/app/mstore/userStore.ts @@ -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;