Fix bugs and add leave

This commit is contained in:
Aslan 2026-01-23 09:26:48 -05:00
parent 5f168fc067
commit a14be66890
2 changed files with 31 additions and 11 deletions

View file

@ -69,15 +69,7 @@ const getLevel = (experience: number): ILevel => {
};
const getUserName = (user: IUser): string => {
const userPattern = /@[a-zA-Z0-9]*/;
const match = user.id.match(userPattern)?.at(0);
if (!match) {
return "";
}
let username = match.replaceAll("@", "");
username = username.charAt(0).toUpperCase() + username.slice(1);
return username;
return getUserNameById(user.id);
};
const getUserNameById = (userId: string): string => {