Skip to content

Commit

Permalink
Update page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ArhanAnsari authored Oct 26, 2024
1 parent 445abc0 commit 50ae871
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ const ProfilePage = () => {

try {
await updateProfile(user, { displayName: name });
// Update name in Firestore as part of the userData object
await updateUserData(user.email!, { ...userData, name });
// Ensure name is updated in Firestore under userData
await updateUserData(user.email!, { ...(userData || {}), name });
setNameEditMode(false);
alert("Name updated successfully!");
} catch (error) {
Expand Down

0 comments on commit 50ae871

Please sign in to comment.