Do not fetch link previews when editing message with attachment

This commit is contained in:
Josh Perez 2023-06-13 08:46:21 -07:00 committed by GitHub
parent ea92bd5f6f
commit b4cafe1e0a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -960,16 +960,19 @@ function onEditorStateChange({
// If we have attachments, don't add link preview
if (
!hasDraftAttachments(conversation.attributes.draftAttachments, {
hasDraftAttachments(conversation.attributes.draftAttachments, {
includePending: true,
})
}) ||
Boolean(conversation.attributes.draftEditMessage?.attachmentThumbnail)
) {
maybeGrabLinkPreview(messageText, LinkPreviewSourceType.Composer, {
caretLocation,
conversationId,
});
return;
}
maybeGrabLinkPreview(messageText, LinkPreviewSourceType.Composer, {
caretLocation,
conversationId,
});
dispatch({
type: 'NOOP',
payload: null,