1.0.80
All checks were successful
Build and Release / build-and-release (push) Successful in 13m27s

This commit is contained in:
Bryan1029384756
2026-04-15 20:06:44 -05:00
parent f2dc627b76
commit 26dd013b05
16 changed files with 398 additions and 18 deletions

View File

@@ -216,11 +216,20 @@ interface LinkEmbedProps {
}
export function LinkEmbed({ url, onOpenGif }: LinkEmbedProps) {
// Thin router: direct media gets its own component, rich previews
// get theirs. Keeping the two paths in separate component instances
// means `useUrlPreview` (which internally wraps `useAction` and
// therefore `useMemo`) is never called conditionally — otherwise a
// URL change that flipped `isDirectMedia` would mutate the hook
// count and trigger React error #310.
const directType = isDirectMedia(url);
if (directType) {
return <DirectMediaEmbed url={url} type={directType} onOpenGif={onOpenGif} />;
}
return <UrlPreviewEmbed url={url} />;
}
function UrlPreviewEmbed({ url }: { url: string }) {
const preview = useUrlPreview(url);
// If the platform has no metadata fetcher (or it returned null / threw),