diff --git a/ts/components/session/conversation/SessionMessagesList.tsx b/ts/components/session/conversation/SessionMessagesList.tsx index 3d3f460fd..922a40d31 100644 --- a/ts/components/session/conversation/SessionMessagesList.tsx +++ b/ts/components/session/conversation/SessionMessagesList.tsx @@ -318,10 +318,6 @@ export class SessionMessagesList extends React.Component { multiSelectMode: boolean, message: MessageModel ) { - if (messageProps.expirationTimestamp != null && messageProps.expirationTimestamp < Date.now()) { - return; - } - const selected = !!messageProps?.id && this.props.selectedMessages.includes(messageProps.id); messageProps.selected = selected; diff --git a/ts/models/message.ts b/ts/models/message.ts index ec58ecf97..c755b8664 100644 --- a/ts/models/message.ts +++ b/ts/models/message.ts @@ -1058,6 +1058,7 @@ export class MessageModel extends Backbone.Model { if (this.get('expireTimer') && !this.get('expirationStartTimestamp')) { const expirationStartTimestamp = Math.min(Date.now(), readAt || Date.now()); this.set({ expirationStartTimestamp }); + this.setToExpire(false); } window.Whisper.Notifications.remove( @@ -1092,7 +1093,7 @@ export class MessageModel extends Backbone.Model { return msFromNow; } - public async setToExpire(force = false) { + public async setToExpire(commit = true, force = false) { if (this.isExpiring() && (force || !this.get('expires_at'))) { const start = this.get('expirationStartTimestamp'); const delta = this.get('expireTimer') * 1000; @@ -1103,7 +1104,7 @@ export class MessageModel extends Backbone.Model { this.set({ expires_at: expiresAt }); const id = this.get('id'); - if (id) { + if (id && commit) { await this.commit(); }