Skip to content

Commit 7f50064

Browse files
committed
(fix) infinite loading when no messages
1 parent 9312800 commit 7f50064

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ChatWindow/Room/Room.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ export default {
465465
room: {
466466
immediate: true,
467467
handler(newVal, oldVal) {
468-
if (!oldVal || (newVal && newVal.roomId !== oldVal.roomId)) {
468+
if (newVal.roomId && (!oldVal || newVal.roomId !== oldVal.roomId)) {
469469
this.onRoomChanged()
470470
}
471471
}
@@ -552,6 +552,10 @@ export default {
552552
setTimeout(() => this.onChangeInput())
553553
}
554554
555+
if (!this.messages.length && this.messagesLoaded) {
556+
this.loadingMessages = false
557+
}
558+
555559
const unwatch = this.$watch(
556560
() => this.messages,
557561
val => {

0 commit comments

Comments
 (0)