Sort message-initiated timer updates before the initiating message

This commit is contained in:
Scott Nonnenberg 2022-03-28 17:25:11 -07:00 committed by GitHub
parent 918616e6ab
commit e62606361d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 22 deletions

View file

@ -2480,8 +2480,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
conversation.updateExpirationTimer(
dataMessage.expireTimer,
source,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
message.getReceivedAt()!,
message,
{
fromGroupUpdate: isGroupUpdate(message.attributes),
}
@ -2492,12 +2491,7 @@ export class MessageModel extends window.Backbone.Model<MessageAttributesType> {
// We only turn off timers if it's not a group update
!isGroupUpdate(message.attributes)
) {
conversation.updateExpirationTimer(
undefined,
source,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
message.getReceivedAt()!
);
conversation.updateExpirationTimer(undefined, source, message);
}
}
}