diff --git a/src/fidgets/farcaster/components/CastRow.tsx b/src/fidgets/farcaster/components/CastRow.tsx index 6012d5ab..d982d357 100644 --- a/src/fidgets/farcaster/components/CastRow.tsx +++ b/src/fidgets/farcaster/components/CastRow.tsx @@ -90,8 +90,12 @@ const CastEmbeds = ({ cast }) => { > {map(cast.embeds, (embed) => { - if (isEmbedUrl(embed)) return renderEmbedForUrl(embed); - return renderEmbedForUrl({ castId: embed.cast_id }); + if (isEmbedUrl(embed)) + return renderEmbedForUrl({ ...embed, key: embed.url }); + return renderEmbedForUrl({ + castId: embed.cast_id, + key: embed.cast_id, + }); })} diff --git a/src/fidgets/farcaster/components/Embeds/index.tsx b/src/fidgets/farcaster/components/Embeds/index.tsx index 98b09de0..f1721649 100644 --- a/src/fidgets/farcaster/components/Embeds/index.tsx +++ b/src/fidgets/farcaster/components/Embeds/index.tsx @@ -15,11 +15,12 @@ export type CastEmbed = { fid: number; hash: string | Uint8Array; }; + key?: string; }; -export const renderEmbedForUrl = ({ url, castId }: CastEmbed) => { +export const renderEmbedForUrl = ({ url, castId, key }: CastEmbed) => { if (castId) { - return ; + return ; } if (!url) return null; @@ -27,28 +28,28 @@ export const renderEmbedForUrl = ({ url, castId }: CastEmbed) => { url.includes("i.imgur.com") || url.startsWith("https://imagedelivery.net") ) { - return ; + return ; } else if (url.startsWith('"chain:')) { - return ; + return ; } else if (url.startsWith("https://stream.warpcast.com")) { - return ; + return ; } else if (url.startsWith("https://warpcast.com") && !url.includes("/~/")) { - return ; + return ; } else if ( (url.includes("twitter.com") || url.startsWith("https://x.com")) && url.includes("status/") ) { const tweetId = url.split("/").pop(); - return tweetId ? : null; + return tweetId ? : null; } else if (url.startsWith("https://nouns.build")) { - return ; + return ; } else if (url.includes("paragraph.xyz") || url.includes("pgrph.xyz")) { - return ; + return ; } else if (!isImageUrl(url)) { // NOTE: Need a better resolver // Currently all URLs that aren't otherise caputured try // To be frames, including things like youtube videos - return ; + return ; } else { return null; }