diff --git a/ts/state/ducks/composer.ts b/ts/state/ducks/composer.ts index fad74cf1c..3c5b87c52 100644 --- a/ts/state/ducks/composer.ts +++ b/ts/state/ducks/composer.ts @@ -679,6 +679,7 @@ function addAttachment( const conversation = window.ConversationController.get(conversationId); if (conversation) { conversation.attributes.draftAttachments = nextAttachments; + conversation.attributes.draftChanged = true; window.Signal.Data.updateConversation(conversation.attributes); } }; @@ -716,6 +717,7 @@ function addPendingAttachment( const conversation = window.ConversationController.get(conversationId); if (conversation) { conversation.attributes.draftAttachments = nextAttachments; + conversation.attributes.draftChanged = true; window.Signal.Data.updateConversation(conversation.attributes); } }; diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 0ca5922fe..cf97b790c 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -3619,15 +3619,12 @@ function onConversationClosed( throw new Error('onConversationClosed: Conversation not found'); } - log.info( - 'unloading conversation', - conversation.idForLogging(), - 'due to:', - reason - ); + const logId = `onConversationClosed/${conversation.idForLogging()}`; + log.info(`${logId}: unloading due to ${reason}`); if (conversation.get('draftChanged')) { if (conversation.hasDraft()) { + log.info(`${logId}: new draft info needs update`); const now = Date.now(); const activeAt = conversation.get('active_at') || now; @@ -3638,6 +3635,7 @@ function onConversationClosed( timestamp: now, }); } else { + log.info(`${logId}: clearing draft info`); conversation.set({ draftChanged: false, draftTimestamp: null,