mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
change the way skipTimerInit is defined in MessageModel
This commit is contained in:
parent
bec9bd553e
commit
54a2eef700
|
@ -439,7 +439,7 @@ export async function deleteMessagesById(
|
|||
askUserForConfirmation: boolean
|
||||
) {
|
||||
const conversationModel = getConversationController().getOrThrow(conversationId);
|
||||
const selectedMessages = _.compact(await Promise.all(messageIds.map(getMessageById)));
|
||||
const selectedMessages = _.compact(await Promise.all(messageIds.map(m => getMessageById(m))));
|
||||
|
||||
const moreThanOne = selectedMessages.length > 1;
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ import { perfEnd, perfStart } from '../session/utils/Performance';
|
|||
import { AttachmentTypeWithPath } from '../types/Attachment';
|
||||
|
||||
export class MessageModel extends Backbone.Model<MessageAttributes> {
|
||||
constructor(attributes: MessageAttributesOptionals) {
|
||||
constructor(attributes: MessageAttributesOptionals & { skipTimerInit?: boolean }) {
|
||||
const filledAttrs = fillMessageAttributesWithDefaults(attributes);
|
||||
super(filledAttrs);
|
||||
|
||||
|
@ -76,7 +76,7 @@ export class MessageModel extends Backbone.Model<MessageAttributes> {
|
|||
}
|
||||
|
||||
// this.on('expired', this.onExpired);
|
||||
if (!filledAttrs.skipTimerInit) {
|
||||
if (!attributes.skipTimerInit) {
|
||||
void this.setToExpire();
|
||||
}
|
||||
autoBind(this);
|
||||
|
|
|
@ -102,12 +102,6 @@ export interface MessageAttributes {
|
|||
* We display a small message just below the message referenced
|
||||
*/
|
||||
dataExtractionNotification?: DataExtractionNotificationMsg;
|
||||
|
||||
/**
|
||||
* This is used to choose whether to initialize the timer or not in the MessageModel object.
|
||||
* If false or undefined, timer will be in itialized.
|
||||
*/
|
||||
skipTimerInit?: boolean;
|
||||
}
|
||||
|
||||
export interface DataExtractionNotificationMsg {
|
||||
|
@ -173,7 +167,6 @@ export interface MessageAttributesOptionals {
|
|||
sync?: boolean;
|
||||
snippet?: any;
|
||||
direction?: any;
|
||||
skipTimerInit?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue