Skip to content

Commit 61e5788

Browse files
committed
(fix) loading with showRoomsList
1 parent fbd2b30 commit 61e5788

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/ChatWindow/ChatWindow.vue

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,18 @@ export default {
127127
rooms: {
128128
immediate: true,
129129
handler(newVal, oldVal) {
130-
if (!this.loadFirstRoom) {
131-
this.room = {}
132-
this.showRoomsList = true
133-
return
134-
}
135-
136130
if (
137131
!newVal[0] ||
138132
!newVal.find(room => room.roomId === this.room.roomId)
139133
) {
140134
this.showRoomsList = true
141135
}
142136
143-
if (newVal[0] && (!oldVal || newVal.length !== oldVal.length)) {
137+
if (
138+
this.loadFirstRoom &&
139+
newVal[0] &&
140+
(!oldVal || newVal.length !== oldVal.length)
141+
) {
144142
if (this.roomId) {
145143
const room = newVal.find(r => r.roomId === this.roomId)
146144
this.fetchRoom({ room })
@@ -153,6 +151,10 @@ export default {
153151
}
154152
},
155153
154+
loadingRooms(val) {
155+
if (val) this.room = {}
156+
},
157+
156158
roomId: {
157159
immediate: true,
158160
handler(val) {

0 commit comments

Comments
 (0)