mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-12-29 03:20:46 +08:00
impr(login page): better error message (Estifanos12) (#5244)
* fix:create user email already exists message * Update account-controller.ts * Update account-controller.ts * Update account-controller.ts * Update account-controller.ts * Update account-controller.ts * Update account-controller.ts
This commit is contained in:
parent
e52cdef46c
commit
abbed321c4
1 changed files with 11 additions and 1 deletions
|
|
@ -591,7 +591,17 @@ async function signUp(): Promise<void> {
|
|||
}
|
||||
Notifications.add("Account created", 1);
|
||||
} catch (e) {
|
||||
const message = Misc.createErrorMessage(e, "Failed to create account");
|
||||
let message = Misc.createErrorMessage(e, "Failed to create account");
|
||||
|
||||
if (e instanceof Error) {
|
||||
if ("code" in e && e.code === "auth/email-already-in-use") {
|
||||
message = Misc.createErrorMessage(
|
||||
{ message: "Email already in use" },
|
||||
"Failed to create account"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Notifications.add(message, -1);
|
||||
LoginPage.hidePreloader();
|
||||
LoginPage.enableInputs();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue