fix lints

Co-authored-by: taskylizard <[email protected]>
This commit is contained in:
Thunderandtaskylizard committed 2026-03-24 00:22:55 +02:00
1 parent a4037c7f62
commit 8cef4107b0
2 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -117,11 +117,11 @@ function RenderMessageContentInternal({
{toRender.map(({ url, type }) => {
if (type) {
return <UrlPreviewCard key={url} url={url} ts={ts} mediaType={type} />;
} else if (clientUrlPreview) {
return <ClientPreview url={url} />;
} else {
return null;
}
if (clientUrlPreview) {
return <ClientPreview url={url} />;
}
return null;
})}
</UrlPreviewHolder>
);
@@ -148,7 +148,7 @@ export const ClientPreview = as<'div', { url: string }>(({ url, ...props }, ref)
// this component is overly complicated, because it was designed to support more embed types than just youtube
// i'm leaving this mess here to support later expansion
const isYoutube = youtubeUrl(url);
const isYoutube = !!youtubeUrl(url);
const videoId = isYoutube ? url.match(/(?:shorts\/|watch\?v=|youtu\.be\/)(.{11})/)?.[1] : null;
const fetchUrl =
@@ -164,7 +164,7 @@ export const ClientPreview = as<'div', { url: string }>(({ url, ...props }, ref)
const fetchYoutube = isYoutube && showYoutube;
if (fetchYoutube) loadEmbed();
}, [loadEmbed]);
}, [isYoutube, showYoutube, loadEmbed]);
let previewContent;