Skip to content

Commit 3f3c87b

Browse files
committed
(fix) add immediate to roomId watcher
1 parent b44eae1 commit 3f3c87b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/ChatWindow/ChatWindow.vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,13 @@ export default {
122122
}
123123
},
124124
125-
roomId(val) {
126-
if (!this.loadingRooms && this.rooms && this.rooms.length) {
127-
const room = this.rooms.find(r => r.roomId === val)
128-
this.fetchRoom({ room })
125+
roomId: {
126+
immediate: true,
127+
handler(val) {
128+
if (!this.loadingRooms && this.rooms && this.rooms.length) {
129+
const room = this.rooms.find(r => r.roomId === val)
130+
this.fetchRoom({ room })
131+
}
129132
}
130133
},
131134

0 commit comments

Comments
 (0)