mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-06 05:43:47 +08:00
handling new data format, showing error message
This commit is contained in:
parent
a0ffa3bb2d
commit
c5011067bf
1 changed files with 8 additions and 5 deletions
|
@ -66,12 +66,12 @@ function signUp() {
|
|||
}
|
||||
|
||||
CloudFunctions.namecheck({ name: nname }).then((d) => {
|
||||
if (d.data === -1) {
|
||||
if (d.data.resultCode === -1) {
|
||||
Misc.showNotification("Name unavailable", 3000);
|
||||
$(".pageLogin .preloader").addClass("hidden");
|
||||
$(".pageLogin .register .button").removeClass("disabled");
|
||||
return;
|
||||
} else if (d.data === -2) {
|
||||
} else if (d.data.resultCode === -2) {
|
||||
Misc.showNotification(
|
||||
"Name cannot contain special characters or contain more than 14 characters. Can include _ . and -",
|
||||
8000
|
||||
|
@ -79,7 +79,7 @@ function signUp() {
|
|||
$(".pageLogin .preloader").addClass("hidden");
|
||||
$(".pageLogin .register .button").removeClass("disabled");
|
||||
return;
|
||||
} else if (d.data === 1) {
|
||||
} else if (d.data.resultCode === 1) {
|
||||
firebase
|
||||
.auth()
|
||||
.createUserWithEmailAndPassword(email, password)
|
||||
|
@ -165,8 +165,11 @@ function signUp() {
|
|||
$(".pageLogin .preloader").addClass("hidden");
|
||||
});
|
||||
} else {
|
||||
console.error(d);
|
||||
Misc.showNotification("Name check timed out", 3000);
|
||||
console.error(d.data.message);
|
||||
Misc.showNotification(
|
||||
"Something went wrong when checking name: " + d.data.message,
|
||||
5000
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue