From 975f43102e17bbb2f7a103659e9e8e859e9a5b2b Mon Sep 17 00:00:00 2001 From: Josh Perez <60019601+josh-signal@users.noreply.github.com> Date: Tue, 13 Jun 2023 09:46:06 -0700 Subject: [PATCH] Remove quote when editing a message --- ts/components/CompositionArea.tsx | 10 +++++++--- ts/state/ducks/conversations.ts | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ts/components/CompositionArea.tsx b/ts/components/CompositionArea.tsx index 70fcfcade41a..c3bd0f7bd579 100644 --- a/ts/components/CompositionArea.tsx +++ b/ts/components/CompositionArea.tsx @@ -893,9 +893,13 @@ export function CompositionArea({ ? () => scrollToMessage(conversationId, quotedMessageId) : undefined } - onClose={() => { - setQuoteByMessageId(conversationId, undefined); - }} + onClose={ + draftEditMessage + ? undefined + : () => { + setQuoteByMessageId(conversationId, undefined); + } + } /> )} diff --git a/ts/state/ducks/conversations.ts b/ts/state/ducks/conversations.ts index 2e414003d687..efcb783c124b 100644 --- a/ts/state/ducks/conversations.ts +++ b/ts/state/ducks/conversations.ts @@ -1754,6 +1754,12 @@ function setMessageToEdit( return; } + setQuoteByMessageId(conversationId, undefined)( + dispatch, + getState, + undefined + ); + let attachmentThumbnail: string | undefined; if (message.attachments) { const thumbnailPath = message.attachments[0]?.thumbnail?.path;