Skip to content

Commit

Permalink
Allow quotes to be removed when editing a message
Browse files Browse the repository at this point in the history
Co-authored-by: Scott Nonnenberg <scott@signal.org>
  • Loading branch information
automated-signal and scottnonnenberg-signal committed Feb 29, 2024
1 parent 5579c4f commit 8cbf91d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
10 changes: 3 additions & 7 deletions ts/components/CompositionArea.tsx
Expand Up @@ -930,13 +930,9 @@ export function CompositionArea({
? () => scrollToMessage(conversationId, quotedMessageId)
: undefined
}
onClose={
draftEditMessage
? undefined
: () => {
setQuoteByMessageId(conversationId, undefined);
}
}
onClose={() => {
setQuoteByMessageId(conversationId, undefined);
}}
/>
</div>
)}
Expand Down
13 changes: 12 additions & 1 deletion ts/state/ducks/composer.ts
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8cbf91d

Please sign in to comment.