From 4f158a98a849c9a0d085beeea372ecd2d387c561 Mon Sep 17 00:00:00 2001 From: k00b Date: Sat, 28 Sep 2024 19:17:15 -0500 Subject: [PATCH] fix link item embed regression --- components/item-full.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/components/item-full.js b/components/item-full.js index a57b8883..044c7cd9 100644 --- a/components/item-full.js +++ b/components/item-full.js @@ -19,12 +19,13 @@ import Share from './share' import Toc from './table-of-contents' import Link from 'next/link' import { RootProvider } from './root' -import { decodeProxyUrl, IMGPROXY_URL_REGEXP } from '@/lib/url' +import { decodeProxyUrl, IMGPROXY_URL_REGEXP, parseEmbedUrl } from '@/lib/url' import { numWithUnits } from '@/lib/format' import { useQuoteReply } from './use-quote-reply' import { UNKNOWN_LINK_REL } from '@/lib/constants' import classNames from 'classnames' import { CarouselProvider } from './carousel' +import Embed from './embed' function BioItem ({ item, handleClick }) { const { me } = useMe() @@ -50,10 +51,18 @@ function BioItem ({ item, handleClick }) { } function ItemEmbed ({ url, imgproxyUrls }) { - const src = IMGPROXY_URL_REGEXP.test(url) ? decodeProxyUrl(url) : url - const srcSet = imgproxyUrls?.[url] + if (imgproxyUrls) { + const src = IMGPROXY_URL_REGEXP.test(url) ? decodeProxyUrl(url) : url + const srcSet = imgproxyUrls?.[url] + return + } - return + const provider = parseEmbedUrl(url) + if (provider) { + return + } + + return null } function FwdUsers ({ forwards }) {