Don't allow link preview and draft attachment at the same time

This commit is contained in:
Jamie Kyle 2023-01-04 15:00:38 -08:00 committed by GitHub
parent 3410971663
commit 7a076be0e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -679,7 +679,11 @@ function onEditorStateChange(
debouncedSaveDraft(conversationId, messageText, bodyRanges);
// If we have attachments, don't add link preview
if (!hasDraftAttachments(conversation.attributes, { includePending: true })) {
if (
!hasDraftAttachments(conversation.attributes.draftAttachments, {
includePending: true,
})
) {
maybeGrabLinkPreview(messageText, LinkPreviewSourceType.Composer, {
caretLocation,
});