diff --git a/ts/state/ducks/composer.ts b/ts/state/ducks/composer.ts index 80492a6f74e..372ea654eef 100644 --- a/ts/state/ducks/composer.ts +++ b/ts/state/ducks/composer.ts @@ -713,6 +713,11 @@ export function setQuoteByMessageId( throw new Error('sendStickerMessage: No conversation found'); } + const draftEditMessage = conversation.get('draftEditMessage'); + if (draftEditMessage) { + return; + } + const message = messageId ? await getMessageById(messageId) : undefined; const state = getState(); @@ -752,7 +757,6 @@ export function setQuoteByMessageId( window.Signal.Data.updateConversation(conversation.attributes); } - const draftEditMessage = conversation.get('draftEditMessage'); if (message) { const quote = await makeQuote(message.attributes); @@ -761,31 +765,15 @@ export function setQuoteByMessageId( return; } - if (draftEditMessage) { - conversation.set({ - draftEditMessage: { - ...draftEditMessage, - quote, - }, - }); - } else { - dispatch( - setQuotedMessage(conversationId, { - conversationId, - quote, - }) - ); - } + dispatch( + setQuotedMessage(conversationId, { + conversationId, + quote, + }) + ); dispatch(setComposerFocus(conversation.id)); dispatch(setComposerDisabledState(conversationId, false)); - } else if (draftEditMessage) { - conversation.set({ - draftEditMessage: { - ...draftEditMessage, - quote: undefined, - }, - }); } else { dispatch(setQuotedMessage(conversationId, undefined)); }