Allow quotes to be removed when editing a message

This commit is contained in:
Scott Nonnenberg
2024-02-29 13:46:19 -08:00
committed by GitHub
parent 96e63964b9
commit ea9a7385d6
2 changed files with 15 additions and 8 deletions

View File

@@ -930,13 +930,9 @@ export function CompositionArea({
? () => scrollToMessage(conversationId, quotedMessageId)
: undefined
}
onClose={
draftEditMessage
? undefined
: () => {
setQuoteByMessageId(conversationId, undefined);
}
}
onClose={() => {
setQuoteByMessageId(conversationId, undefined);
}}
/>
</div>
)}

View File

@@ -749,7 +749,18 @@ export function setQuoteByMessageId(
}
const draftEditMessage = conversation.get('draftEditMessage');
if (draftEditMessage) {
// We can remove quotes, but we can't add them
if (draftEditMessage && messageId) {
return;
}
if (draftEditMessage && draftEditMessage.quote) {
conversation.set({
draftEditMessage: {
...draftEditMessage,
quote: undefined,
},
});
dispatch(setComposerFocus(conversation.id));
return;
}