fix: remove unnecessary async on markReadNoCommit

pull/2971/head
William Grant 2 years ago
parent 7b8d1ed2f7
commit 8d9fc33180

@ -1093,7 +1093,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
} }
public async markMessageAsRead(readAt: number) { public async markMessageAsRead(readAt: number) {
await this.markMessageReadNoCommit(readAt); this.markMessageReadNoCommit(readAt);
await this.commit(); await this.commit();
// the line below makes sure that getNextExpiringMessage will find this message as expiring. // the line below makes sure that getNextExpiringMessage will find this message as expiring.
// getNextExpiringMessage is used on app start to clean already expired messages which should have been removed already, but are not // getNextExpiringMessage is used on app start to clean already expired messages which should have been removed already, but are not
@ -1102,7 +1102,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
await this.getConversation()?.refreshInMemoryDetails(); await this.getConversation()?.refreshInMemoryDetails();
} }
public async markMessageReadNoCommit(readAt: number) { public markMessageReadNoCommit(readAt: number) {
this.set({ unread: READ_MESSAGE_STATE.read }); this.set({ unread: READ_MESSAGE_STATE.read });
const convo = this.getConversation(); const convo = this.getConversation();

Loading…
Cancel
Save