diff --git a/ts/components/session/conversation/SessionCompositionBox.tsx b/ts/components/session/conversation/SessionCompositionBox.tsx index 200b73e6c..c54a85729 100644 --- a/ts/components/session/conversation/SessionCompositionBox.tsx +++ b/ts/components/session/conversation/SessionCompositionBox.tsx @@ -290,7 +290,7 @@ export class SessionCompositionBox extends React.Component { const { ignoredLink } = this.state; // Don't render link previews if quoted message or attachments are already added - if (stagedAttachments.length !== 0 && quotedMessageProps?.id) { + if (stagedAttachments.length !== 0 || quotedMessageProps?.id) { return <>; } // we try to match the first link found in the current message diff --git a/ts/components/session/conversation/SessionStagedLinkPreview.tsx b/ts/components/session/conversation/SessionStagedLinkPreview.tsx index 9e48b1b63..326a6c69d 100644 --- a/ts/components/session/conversation/SessionStagedLinkPreview.tsx +++ b/ts/components/session/conversation/SessionStagedLinkPreview.tsx @@ -34,7 +34,7 @@ export const getPreview = async ( ): Promise => { // This is already checked elsewhere, but we want to be extra-careful. if (!window.Signal.LinkPreviews.isLinkSafeToPreview(url)) { - return null; + throw new Error('Link not safe for preview'); } const linkPreviewMetadata = await LinkPreviewUtil.fetchLinkPreviewMetadata( @@ -43,7 +43,7 @@ export const getPreview = async ( abortSignal ); if (!linkPreviewMetadata) { - return null; + throw new Error('Could not fetch link preview metadata'); } const { title, imageHref, description, date } = linkPreviewMetadata;