Mark all calls read when opening calls tab

This commit is contained in:
Jamie Kyle 2023-08-22 14:01:36 -07:00 committed by GitHub
parent b7c17212c7
commit 344ebf494d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 80 additions and 17 deletions

View file

@ -223,7 +223,7 @@ export class ConversationModel extends window.Backbone
contactCollection?: Backbone.Collection<ConversationModel>;
debouncedUpdateLastMessage?: (() => void) & { flush(): void };
debouncedUpdateLastMessage: (() => void) & { flush(): void };
initialPromise?: Promise<unknown>;
@ -1400,9 +1400,7 @@ export class ConversationModel extends window.Backbone
): Promise<void> {
await this.beforeAddSingleMessage(message);
this.doAddSingleMessage(message, { isJustSent });
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.debouncedUpdateLastMessage!();
this.debouncedUpdateLastMessage();
}
private async beforeAddSingleMessage(message: MessageModel): Promise<void> {
@ -5221,7 +5219,7 @@ export class ConversationModel extends window.Backbone
async flushDebouncedUpdates(): Promise<void> {
try {
await this.debouncedUpdateLastMessage?.flush();
this.debouncedUpdateLastMessage.flush();
} catch (error) {
const logId = this.idForLogging();
log.error(

View file

@ -1148,7 +1148,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
sticker: undefined,
...additionalProperties,
});
this.getConversation()?.debouncedUpdateLastMessage?.();
this.getConversation()?.debouncedUpdateLastMessage();
if (shouldPersist) {
await window.Signal.Data.saveMessage(this.attributes, {
@ -1485,7 +1485,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
saveErrors?: (errors: Array<Error>) => void
): Promise<void> {
const updateLeftPane =
this.getConversation()?.debouncedUpdateLastMessage || noop;
this.getConversation()?.debouncedUpdateLastMessage ?? noop;
updateLeftPane();