File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -381,6 +381,7 @@ export default Vue.extend({
381381 },
382382
383383 async loadData() {
384+ await this .$store .dispatch (' loadUser' )
384385 await this .$store .dispatch (' loadPhones' )
385386 await this .$store .dispatch (' loadThreads' )
386387
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ export default {
3939
4040 methods: {
4141 async loadData () {
42+ await this .$store .dispatch (' loadUser' )
4243 await this .$store .dispatch (' loadPhones' )
4344 await this .$store .dispatch (' loadThreads' )
4445 },
Original file line number Diff line number Diff line change @@ -318,6 +318,15 @@ export const actions = {
318318
319319 const response = await axios . get ( '/v1/phones' , { params : { limit : 100 } } )
320320 context . commit ( 'setPhones' , response . data . data )
321+
322+ if ( context . state . user && context . state . user . active_phone_id ) {
323+ const phone = response . data . data . find (
324+ ( x : Phone ) => x . id === context . state . user ?. active_phone_id
325+ )
326+ if ( phone ) {
327+ context . commit ( 'setOwner' , phone . phone_number )
328+ }
329+ }
321330 } ,
322331
323332 async loadUser ( context : ActionContext < State , State > ) {
You can’t perform that action at this time.
0 commit comments