File tree Expand file tree Collapse file tree 2 files changed +20
-13
lines changed Expand file tree Collapse file tree 2 files changed +20
-13
lines changed Original file line number Diff line number Diff line change @@ -113,15 +113,18 @@ export default {
113
113
},
114
114
115
115
watch: {
116
- rooms (newVal , oldVal ) {
117
- if (newVal[0 ] && newVal .length !== oldVal .length ) {
118
- if (this .roomId ) {
119
- const room = newVal .find (r => r .roomId === this .roomId )
120
- this .fetchRoom ({ room })
121
- } else if (! this .isMobile ) {
122
- this .fetchRoom ({ room: this .orderedRooms [0 ] })
123
- } else {
124
- this .showRoomsList = true
116
+ rooms: {
117
+ immediate: true ,
118
+ handler (newVal , oldVal ) {
119
+ if (newVal[0 ] && (! oldVal || newVal .length !== oldVal .length )) {
120
+ if (this .roomId ) {
121
+ const room = newVal .find (r => r .roomId === this .roomId )
122
+ this .fetchRoom ({ room })
123
+ } else if (! this .isMobile ) {
124
+ this .fetchRoom ({ room: this .orderedRooms [0 ] })
125
+ } else {
126
+ this .showRoomsList = true
127
+ }
125
128
}
126
129
}
127
130
},
@@ -157,7 +160,7 @@ export default {
157
160
}
158
161
},
159
162
160
- mounted () {
163
+ created () {
161
164
this .updateResponsive ()
162
165
window .addEventListener (' resize' , ev => {
163
166
if (ev .isTrusted ) this .updateResponsive ()
Original file line number Diff line number Diff line change @@ -114,8 +114,12 @@ export default {
114
114
rooms (val ) {
115
115
this .filteredRooms = val
116
116
},
117
- room (val ) {
118
- if (val) this .selectedRoomId = val .roomId
117
+
118
+ room: {
119
+ immediate: true ,
120
+ handler (val ) {
121
+ if (val && ! this .isMobile ) this .selectedRoomId = val .roomId
122
+ }
119
123
}
120
124
},
121
125
@@ -129,7 +133,7 @@ export default {
129
133
},
130
134
openRoom (room ) {
131
135
if (room .roomId === this .room .roomId && ! this .isMobile ) return
132
- this .selectedRoomId = room .roomId
136
+ if ( ! this . isMobile ) this .selectedRoomId = room .roomId
133
137
this .$emit (' fetchRoom' , { room })
134
138
},
135
139
addRoom () {
You can’t perform that action at this time.
0 commit comments