diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-08-02 13:59:05 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-08-02 13:59:05 +0900 |
| commit | 0e9a8c0cd48361cb07b78740fd2b1eeddbc6cd55 (patch) | |
| tree | 98d651db396cf679d686bb1582638f99da5b71a6 /src/client | |
| parent | refactor (diff) | |
| download | sharkey-0e9a8c0cd48361cb07b78740fd2b1eeddbc6cd55.tar.gz sharkey-0e9a8c0cd48361cb07b78740fd2b1eeddbc6cd55.tar.bz2 sharkey-0e9a8c0cd48361cb07b78740fd2b1eeddbc6cd55.zip | |
fix(client): Message read state is not reactive
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/pages/messaging/messaging-room.vue | 10 |
1 files 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] + }; } } } |