@@ -510,7 +510,10 @@ export const actions = {
510510 ( x : Phone ) => x . id === context . getters . getUser . active_phone_id
511511 )
512512 if ( phone ) {
513- await context . dispatch ( 'setOwner' , phone . phone_number )
513+ await context . dispatch ( 'updateUser' , {
514+ owner : phone . phone_number ,
515+ timezone : context . getters . getUser . timezone ,
516+ } )
514517 }
515518 }
516519 } ,
@@ -550,8 +553,11 @@ export const actions = {
550553 await context . commit ( 'setAxiosError' , null )
551554 } ,
552555
553- async setOwner ( context : ActionContext < State , State > , owner : string ) {
554- await context . commit ( 'setOwner' , owner )
556+ async updateUser (
557+ context : ActionContext < State , State > ,
558+ payload : { owner : string ; timezone : string }
559+ ) {
560+ await context . commit ( 'setOwner' , payload . owner )
555561
556562 const phone = context . getters . getActivePhone as Phone | null
557563 if ( ! phone ) {
@@ -560,6 +566,7 @@ export const actions = {
560566
561567 const response = await axios . put ( '/v1/users/me' , {
562568 active_phone_id : phone . id ,
569+ timezone : payload . timezone ?? context . getters . getUser . timezone ,
563570 } )
564571
565572 setApiKey ( response . data . data . api_key )
0 commit comments