Skip to content

Commit

Permalink
fixup broken profile update; prepare for calling UpdateUser instead o…
Browse files Browse the repository at this point in the history
…f partial updates
  • Loading branch information
AlexTugarev committed Nov 29, 2023
1 parent 4027ce4 commit c71ddd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
1 change: 1 addition & 0 deletions components/dashboard/src/user-settings/Account.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default function Account() {
}

await updateUser.mutateAsync({
fullName: profileState.name,
additionalData: {
profile: profileState,
},
Expand Down
17 changes: 0 additions & 17 deletions components/gitpod-protocol/src/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,23 +194,6 @@ export namespace User {
};
}

export function setProfile(user: User, profile: Profile): User {
user.fullName = profile.name;
user.avatarUrl = profile.avatarURL;

if (!user.additionalData) {
user.additionalData = {};
}
if (!user.additionalData.profile) {
user.additionalData.profile = {};
}
user.additionalData.profile.emailAddress = profile.email;
user.additionalData.profile.companyName = profile.company;
user.additionalData.profile.lastUpdatedDetailsNudge = new Date().toISOString();

return user;
}

// TODO: refactor where this is referenced so it's more clearly tied to just analytics-tracking
// Let other places rely on the ProfileDetails type since that's what we store
// This is the profile data we send to our Segment analytics tracking pipeline
Expand Down

0 comments on commit c71ddd7

Please sign in to comment.