Improve timeline rendering performance

This commit is contained in:
trevor-signal 2024-02-27 11:01:25 -05:00 committed by GitHub
parent c319a089d2
commit 167b2f4f1c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 329 additions and 106 deletions

View file

@ -2,13 +2,11 @@
// SPDX-License-Identifier: AGPL-3.0-only
import {
isEmpty,
isNumber,
isObject,
mapValues,
maxBy,
noop,
omit,
partition,
pick,
union,
@ -58,7 +56,7 @@ import {
SendStatus,
isSent,
sendStateReducer,
someSendStatus,
someRecipientSendStatus,
} from '../messages/MessageSendState';
import { migrateLegacyReadStatus } from '../messages/migrateLegacyReadStatus';
import { migrateLegacySendAttributes } from '../messages/migrateLegacySendAttributes';
@ -824,11 +822,14 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
public hasSuccessfulDelivery(): boolean {
const sendStateByConversationId = this.get('sendStateByConversationId');
const withoutMe = omit(
sendStateByConversationId,
window.ConversationController.getOurConversationIdOrThrow()
const ourConversationId =
window.ConversationController.getOurConversationIdOrThrow();
return someRecipientSendStatus(
sendStateByConversationId ?? {},
ourConversationId,
isSent
);
return isEmpty(withoutMe) || someSendStatus(withoutMe, isSent);
}
/**