mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 02:13:09 +02:00
fix(client): Message read state is not reactive
This commit is contained in:
parent
5ae8a3c7e8
commit
0e9a8c0cd4
1 changed files with 8 additions and 2 deletions
|
@ -221,14 +221,20 @@ export default Vue.extend({
|
||||||
for (const id of x) {
|
for (const id of x) {
|
||||||
if (this.messages.some(x => x.id == id)) {
|
if (this.messages.some(x => x.id == id)) {
|
||||||
const exist = this.messages.map(x => x.id).indexOf(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) {
|
} else if (this.group) {
|
||||||
for (const id of x.ids) {
|
for (const id of x.ids) {
|
||||||
if (this.messages.some(x => x.id == id)) {
|
if (this.messages.some(x => x.id == id)) {
|
||||||
const exist = this.messages.map(x => x.id).indexOf(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]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue