Attachment Modal: Remove compression update on paste (#6444)

This commit is contained in:
Alexander Zinchuk 2025-11-06 11:36:50 +01:00
parent a652cf97ae
commit 5fa084c78d
2 changed files with 7 additions and 3 deletions

View File

@ -994,6 +994,7 @@ const Composer: FC<OwnProps & StateProps> = ({
editingMessage, editingMessage,
!isCurrentUserPremium && !isChatWithSelf, !isCurrentUserPremium && !isChatWithSelf,
showCustomEmojiPremiumNotification, showCustomEmojiPremiumNotification,
!attachments.length,
); );
const handleEmbeddedClear = useLastCallback(() => { const handleEmbeddedClear = useLastCallback(() => {

View File

@ -31,6 +31,7 @@ const useClipboardPaste = (
editedMessage: ApiMessage | undefined, editedMessage: ApiMessage | undefined,
shouldStripCustomEmoji?: boolean, shouldStripCustomEmoji?: boolean,
onCustomEmojiStripped?: VoidFunction, onCustomEmojiStripped?: VoidFunction,
shouldUpdateAttachmentCompression?: boolean,
) => { ) => {
const { const {
showNotification, showNotification,
@ -130,8 +131,10 @@ const useClipboardPaste = (
} }
if (shouldSetAttachments) { if (shouldSetAttachments) {
updateShouldSaveAttachmentsCompression({ shouldSave: true }); if (shouldUpdateAttachmentCompression) {
applyDefaultAttachmentsCompression(); updateShouldSaveAttachmentsCompression({ shouldSave: true });
applyDefaultAttachmentsCompression();
}
setAttachments(editedMessage ? newAttachments : (attachments) => attachments.concat(newAttachments)); setAttachments(editedMessage ? newAttachments : (attachments) => attachments.concat(newAttachments));
} }
@ -151,7 +154,7 @@ const useClipboardPaste = (
}; };
}, [ }, [
insertTextAndUpdateCursor, editedMessage, setAttachments, isActive, shouldStripCustomEmoji, insertTextAndUpdateCursor, editedMessage, setAttachments, isActive, shouldStripCustomEmoji,
onCustomEmojiStripped, setNextText, lang, onCustomEmojiStripped, setNextText, lang, shouldUpdateAttachmentCompression,
]); ]);
}; };