diff --git a/src/components/common/Composer.tsx b/src/components/common/Composer.tsx index d59923277..6a28db9e9 100644 --- a/src/components/common/Composer.tsx +++ b/src/components/common/Composer.tsx @@ -994,6 +994,7 @@ const Composer: FC = ({ editingMessage, !isCurrentUserPremium && !isChatWithSelf, showCustomEmojiPremiumNotification, + !attachments.length, ); const handleEmbeddedClear = useLastCallback(() => { diff --git a/src/components/middle/composer/hooks/useClipboardPaste.ts b/src/components/middle/composer/hooks/useClipboardPaste.ts index 810e30489..169c1ab75 100644 --- a/src/components/middle/composer/hooks/useClipboardPaste.ts +++ b/src/components/middle/composer/hooks/useClipboardPaste.ts @@ -31,6 +31,7 @@ const useClipboardPaste = ( editedMessage: ApiMessage | undefined, shouldStripCustomEmoji?: boolean, onCustomEmojiStripped?: VoidFunction, + shouldUpdateAttachmentCompression?: boolean, ) => { const { showNotification, @@ -130,8 +131,10 @@ const useClipboardPaste = ( } if (shouldSetAttachments) { - updateShouldSaveAttachmentsCompression({ shouldSave: true }); - applyDefaultAttachmentsCompression(); + if (shouldUpdateAttachmentCompression) { + updateShouldSaveAttachmentsCompression({ shouldSave: true }); + applyDefaultAttachmentsCompression(); + } setAttachments(editedMessage ? newAttachments : (attachments) => attachments.concat(newAttachments)); } @@ -151,7 +154,7 @@ const useClipboardPaste = ( }; }, [ insertTextAndUpdateCursor, editedMessage, setAttachments, isActive, shouldStripCustomEmoji, - onCustomEmojiStripped, setNextText, lang, + onCustomEmojiStripped, setNextText, lang, shouldUpdateAttachmentCompression, ]); };