File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 29
29
"countries-list" : " ^2.6.1" ,
30
30
"crypto-browserify" : " 3.12.0" ,
31
31
"dayjs" : " ^1.11.5" ,
32
+ "deepmerge" : " ^4.2.2" ,
32
33
"file-saver" : " ^2.0.5" ,
33
34
"idb-keyval" : " ^6.2.0" ,
34
35
"js-cookie" : " ^3.0.1" ,
Original file line number Diff line number Diff line change 4
4
* See License.AGPL.txt in the project root for license information.
5
5
*/
6
6
7
- import { User as UserProtocol } from "@gitpod/gitpod-protocol" ;
7
+ import { AdditionalUserData , User as UserProtocol } from "@gitpod/gitpod-protocol" ;
8
8
import { useMutation } from "@tanstack/react-query" ;
9
9
import { trackEvent } from "../../Analytics" ;
10
10
import { getGitpodService } from "../../service/service" ;
11
11
import { useAuthenticatedUser } from "./authenticated-user-query" ;
12
12
import { converter } from "../../service/public-api" ;
13
+ import deepmerge from "deepmerge" ;
13
14
14
15
type UpdateCurrentUserArgs = Partial < UserProtocol > ;
15
16
@@ -20,10 +21,10 @@ export const useUpdateCurrentUserMutation = () => {
20
21
const update : UpdateCurrentUserArgs = {
21
22
id : current . id ,
22
23
fullName : partialUser . fullName || current . fullName ,
23
- additionalData : {
24
- ... current . additionalData ,
25
- ... partialUser . additionalData ,
26
- } ,
24
+ additionalData : deepmerge < AdditionalUserData > (
25
+ current . additionalData || { } ,
26
+ partialUser . additionalData || { } ,
27
+ ) ,
27
28
} ;
28
29
const user = await getGitpodService ( ) . server . updateLoggedInUser ( update ) ;
29
30
return converter . toUser ( user ) ;
You can’t perform that action at this time.
0 commit comments