fix(client): Message read state is not reactive

This commit is contained in:
syuilo 2020-08-02 13:59:05 +09:00
parent e7612790f5
commit 9acdcc4b78

View file

@ -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]
};
}
}
}