Allow quotes to be removed when editing a message

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
automated-signal 2024-02-29 17:08:29 -06:00 committed by GitHub
parent 99f2ed59ae
commit 560aed207c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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;
}