From 0e9a8c0cd48361cb07b78740fd2b1eeddbc6cd55 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 2 Aug 2020 13:59:05 +0900 Subject: [PATCH] fix(client): Message read state is not reactive --- src/client/pages/messaging/messaging-room.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/pages/messaging/messaging-room.vue b/src/client/pages/messaging/messaging-room.vue index e8c6257f3f..abff3062c9 100644 --- a/src/client/pages/messaging/messaging-room.vue +++ b/src/client/pages/messaging/messaging-room.vue @@ -221,14 +221,20 @@ export default Vue.extend({ for (const id of x) { if (this.messages.some(x => x.id == id)) { const exist = this.messages.map(x => x.id).indexOf(id); - this.messages[exist].isRead = true; + this.messages[exist] = { + ...this.messages[exist], + isRead: true, + }; } } } else if (this.group) { for (const id of x.ids) { if (this.messages.some(x => x.id == id)) { const exist = this.messages.map(x => x.id).indexOf(id); - this.messages[exist].reads.push(x.userId); + this.messages[exist] = { + ...this.messages[exist], + reads: [...this.messages[exist].reads, x.userId] + }; } } }