fix: ensure the user data is setup correct on the main page

This commit is contained in:
BennyKok
2024-01-17 16:43:31 +08:00
parent f8ac6fb251
commit 9962a415be
2 changed files with 22 additions and 4 deletions
+2 -1
View File
@@ -6,7 +6,8 @@ export async function setInitialUserData(userId: string) {
const user = await clerkClient.users.getUser(userId);
// incase we dont have username such as google login, fallback to first name + last name
const usernameFallback = user.username ?? (user.firstName ?? "") + (user.lastName ?? "");
const usernameFallback =
user.username ?? (user.firstName ?? "") + (user.lastName ?? "");
// For the display name, if it for some reason is empty, fallback to username
let nameFallback = (user.firstName ?? "") + (user.lastName ?? "");