enqueueMessageForSend: Capture storage service change on unarchive
This commit is contained in:
parent
06b606cec3
commit
1dc27a6144
1 changed files with 10 additions and 5 deletions
|
@ -4008,9 +4008,11 @@ export class ConversationModel extends window.Backbone
|
||||||
const { clearUnreadMetrics } = window.reduxActions.conversations;
|
const { clearUnreadMetrics } = window.reduxActions.conversations;
|
||||||
clearUnreadMetrics(this.id);
|
clearUnreadMetrics(this.id);
|
||||||
|
|
||||||
const enableProfileSharing = Boolean(
|
const enabledProfileSharing = Boolean(
|
||||||
mandatoryProfileSharingEnabled && !this.get('profileSharing')
|
mandatoryProfileSharingEnabled && !this.get('profileSharing')
|
||||||
);
|
);
|
||||||
|
const unarchivedConversation = Boolean(this.get('isArchived'));
|
||||||
|
|
||||||
this.doAddSingleMessage(model, { isJustSent: true });
|
this.doAddSingleMessage(model, { isJustSent: true });
|
||||||
|
|
||||||
const draftProperties = dontClearDraft
|
const draftProperties = dontClearDraft
|
||||||
|
@ -4024,15 +4026,18 @@ export class ConversationModel extends window.Backbone
|
||||||
|
|
||||||
this.set({
|
this.set({
|
||||||
...draftProperties,
|
...draftProperties,
|
||||||
...(enableProfileSharing ? { profileSharing: true } : {}),
|
...(enabledProfileSharing ? { profileSharing: true } : {}),
|
||||||
...this.incrementSentMessageCount({ dry: true }),
|
...this.incrementSentMessageCount({ dry: true }),
|
||||||
active_at: now,
|
active_at: now,
|
||||||
timestamp: now,
|
timestamp: now,
|
||||||
isArchived: false,
|
...(unarchivedConversation ? { isArchived: false } : {}),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (enableProfileSharing) {
|
if (enabledProfileSharing) {
|
||||||
this.captureChange('mandatoryProfileSharing');
|
this.captureChange('enqueueMessageForSend/mandatoryProfileSharing');
|
||||||
|
}
|
||||||
|
if (unarchivedConversation) {
|
||||||
|
this.captureChange('enqueueMessageForSend/unarchive');
|
||||||
}
|
}
|
||||||
|
|
||||||
extraReduxActions?.();
|
extraReduxActions?.();
|
||||||
|
|
Loading…
Reference in a new issue