Better draft attachment management logic
This commit is contained in:
parent
7fde9a311f
commit
32f65e86a3
3 changed files with 29 additions and 21 deletions
|
@ -180,7 +180,10 @@ export type OwnProps = Readonly<{
|
|||
quotedMessageAuthorAci: AciString | null;
|
||||
quotedMessageSentAt: number | null;
|
||||
|
||||
removeAttachment: (conversationId: string, filePath: string) => unknown;
|
||||
removeAttachment: (
|
||||
conversationId: string,
|
||||
attachment: AttachmentDraftType
|
||||
) => unknown;
|
||||
scrollToMessage: (conversationId: string, messageId: string) => unknown;
|
||||
setComposerFocus: (conversationId: string) => unknown;
|
||||
setMessageToEdit(conversationId: string, messageId: string): unknown;
|
||||
|
@ -1172,9 +1175,7 @@ export const CompositionArea = memo(function CompositionArea({
|
|||
onClickAttachment={maybeEditAttachment}
|
||||
onClose={() => onClearAttachments(conversationId)}
|
||||
onCloseAttachment={attachment => {
|
||||
if (attachment.path) {
|
||||
removeAttachment(conversationId, attachment.path);
|
||||
}
|
||||
removeAttachment(conversationId, attachment);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue