From 7a076be0e7ec1797bdf1032b66f58e8b8257fb33 Mon Sep 17 00:00:00 2001 From: Jamie Kyle <113370520+jamiebuilds-signal@users.noreply.github.com> Date: Wed, 4 Jan 2023 15:00:38 -0800 Subject: [PATCH] Don't allow link preview and draft attachment at the same time --- ts/state/ducks/composer.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ts/state/ducks/composer.ts b/ts/state/ducks/composer.ts index 7d43dd9fc..ca9f84e67 100644 --- a/ts/state/ducks/composer.ts +++ b/ts/state/ducks/composer.ts @@ -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, });