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,
!isCurrentUserPremium && !isChatWithSelf,
showCustomEmojiPremiumNotification,
!attachments.length,
);
const handleEmbeddedClear = useLastCallback(() => {

View File

@ -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,
]);
};