Attachment Modal: Remove compression update on paste (#6444)
This commit is contained in:
parent
a652cf97ae
commit
5fa084c78d
@ -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(() => {
|
||||||
|
|||||||
@ -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,
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user