flagging user for name change if their name is nullish

This commit is contained in:
Miodec 2023-07-01 11:18:28 +02:00
parent afd2d3442e
commit 4c079f2516
3 changed files with 8 additions and 3 deletions

View file

@ -360,6 +360,11 @@ export async function getUser(
inboxUnreadSize = _.filter(userInfo.inbox, { read: false }).length;
}
if (!userInfo.name) {
userInfo.needsToChangeName = true;
UserDAL.flagForNameChange(uid);
}
const userData = {
...getRelevantUserInfo(userInfo),
inboxUnreadSize: inboxUnreadSize,

View file

@ -144,7 +144,7 @@ export async function getDataAndInit(): Promise<boolean> {
if (snapshot.needsToChangeName) {
Notifications.addBanner(
"Your name was reset. <a class='openNameChange'>Click here</a> to change it and learn more about why.",
"You need to update your account name. <a class='openNameChange'>Click here</a> to change it and learn more about why.",
-1,
undefined,
true,

View file

@ -470,7 +470,7 @@ list["updateName"] = new SimplePopup(
if (snapshot.needsToChangeName) {
setTimeout(() => {
location.reload();
}, 3000);
}, 1000);
}
} catch (e) {
const typedError = e as FirebaseError;
@ -492,7 +492,7 @@ list["updateName"] = new SimplePopup(
}
if (snapshot.needsToChangeName === true) {
thisPopup.text =
"We've recently identified several issues that allowed users to register with names that were already taken. Accounts which signed up earliest get to keep the duplicated name, and others are forced to change. Unique names are essential for smooth operation of upcoming features like public profiles, multiplayer, and more. Sorry for the inconvenience.";
"You need to change your account name. This might be because you have a duplicate name, no account name or your name is not allowed. Sorry for the inconvenience.";
}
},
(_thisPopup) => {