mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 07:46:15 +08:00
fixed name update process
This commit is contained in:
parent
355517ac53
commit
616434f7a1
|
@ -150,7 +150,7 @@ exports.changeDisplayName = functions.https.onCall(
|
|||
await db
|
||||
.collection("users")
|
||||
.doc(request.uid)
|
||||
.update({ name: request.name });
|
||||
.set({ name: request.name }, { merge: true });
|
||||
await db.collection("takenNames").doc(request.name.toLowerCase()).set(
|
||||
{
|
||||
taken: true,
|
||||
|
|
|
@ -323,7 +323,7 @@ function getAccountDataAndInit() {
|
|||
db_updateName(user.uid, user.displayName);
|
||||
} else {
|
||||
//invalid, get new
|
||||
Notifications.add("Invalid name", 0);
|
||||
// Notifications.add("Invalid name", 0);
|
||||
let promptVal = null;
|
||||
let cdnVal = undefined;
|
||||
|
||||
|
@ -340,10 +340,10 @@ function getAccountDataAndInit() {
|
|||
name: promptVal,
|
||||
});
|
||||
if (cdnVal.data.status === 1) {
|
||||
Notifications.add("Name updated", 1);
|
||||
alert("Name updated", 1);
|
||||
location.reload();
|
||||
} else if (cdnVal.data.status < 0) {
|
||||
Notifications.add(cdnVal.data.message, 0);
|
||||
alert(cdnVal.data.message, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue