Skip to content

Commit 21536b5

Browse files
committed
(fix) roomId initialization
1 parent e174230 commit 21536b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ChatWindow/ChatWindow.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,11 @@ export default {
201201
202202
roomId: {
203203
immediate: true,
204-
handler(val) {
205-
if (val && !this.loadingRooms && this.rooms.length) {
206-
const room = this.rooms.find(r => r.roomId === val)
204+
handler(newVal, oldVal) {
205+
if (newVal && !this.loadingRooms && this.rooms.length) {
206+
const room = this.rooms.find(r => r.roomId === newVal)
207207
this.fetchRoom({ room })
208-
} else if (!val) {
208+
} else if (oldVal && !newVal) {
209209
this.room = {}
210210
}
211211
}

0 commit comments

Comments
 (0)