Skip to content

Commit

Permalink
Refactor user name handling in onboarding and profile edit pages
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinsjoy committed Aug 13, 2024
1 parent 6168c99 commit ce99316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion app/(auth)/onboarding/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ async function Page() {
id: user.id,
objectId: userInfo?._id,
username: userInfo ? userInfo?.username : user.username,
name: userInfo ? userInfo?.name : user.firstName ?? '',
name: userInfo
? userInfo?.name
: `${user.firstName} ${user.lastName}` ?? '',
bio: userInfo ? userInfo?.bio : '',
image: userInfo ? userInfo?.image : user.imageUrl,
};
Expand Down
4 changes: 3 additions & 1 deletion app/(root)/profile/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ async function Page() {
id: user.id,
objectId: userInfo?._id,
username: userInfo ? userInfo?.username : user.username,
name: userInfo ? userInfo?.name : user.firstName ?? '',
name: userInfo
? userInfo?.name
: `${user.firstName} ${user.lastName}` ?? '',
bio: userInfo ? userInfo?.bio : '',
image: userInfo ? userInfo?.image : user.imageUrl,
};
Expand Down

0 comments on commit ce99316

Please sign in to comment.