Update conversation.unreadCount in just one place, from database
This commit is contained in:
parent
a9c788b689
commit
d4e0f6a38d
3 changed files with 12 additions and 6 deletions
|
@ -4644,10 +4644,16 @@ export class ConversationModel extends window.Backbone
|
|||
}
|
||||
): Promise<void> {
|
||||
await markConversationRead(this.attributes, newestUnreadAt, options);
|
||||
await this.updateUnread();
|
||||
}
|
||||
|
||||
async updateUnread(): Promise<void> {
|
||||
const unreadCount = await window.Signal.Data.getTotalUnreadForConversation(
|
||||
this.id,
|
||||
{ storyId: undefined, isGroup: isGroup(this.attributes) }
|
||||
{
|
||||
storyId: undefined,
|
||||
isGroup: isGroup(this.attributes),
|
||||
}
|
||||
);
|
||||
|
||||
const prevUnreadCount = this.get('unreadCount');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue