Conversation.setMarkedUnread: Only captureChange if value changed
This commit is contained in:
parent
4ef4aebf85
commit
a5cfebe87a
1 changed files with 7 additions and 1 deletions
|
@ -3049,9 +3049,15 @@ export class ConversationModel extends window.Backbone.Model<
|
||||||
}
|
}
|
||||||
|
|
||||||
setMarkedUnread(markedUnread: boolean): void {
|
setMarkedUnread(markedUnread: boolean): void {
|
||||||
|
const previousMarkedUnread = this.get('markedUnread');
|
||||||
|
|
||||||
this.set({ markedUnread });
|
this.set({ markedUnread });
|
||||||
window.Signal.Data.updateConversation(this.attributes);
|
window.Signal.Data.updateConversation(this.attributes);
|
||||||
this.captureChange('markedUnread');
|
|
||||||
|
if (Boolean(previousMarkedUnread) !== Boolean(markedUnread)) {
|
||||||
|
this.captureChange('markedUnread');
|
||||||
|
}
|
||||||
|
|
||||||
window.Whisper.events.trigger('updateUnreadCount');
|
window.Whisper.events.trigger('updateUnreadCount');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue