From 7f9f3648cbfa4b93862b4034eb3cd9523821b1a0 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 7 Aug 2023 01:07:18 +0100 Subject: [PATCH] fix: nft ipfs link --- src/app/site/[site]/nft/page.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/site/[site]/nft/page.tsx b/src/app/site/[site]/nft/page.tsx index 48d9925c..b1179ec6 100644 --- a/src/app/site/[site]/nft/page.tsx +++ b/src/app/site/[site]/nft/page.tsx @@ -113,7 +113,11 @@ export default async function SiteNFTPage({ ? `data:image/svg+xml,${encodeURIComponent( nft.content_uri, )}` || "" - : toGateway(`ipfs://${nft.content_uri}`) || "" + : toGateway( + nft.content_uri?.startsWith?.("ipfs://") + ? nft.content_uri + : `ipfs://${nft.content_uri}`, + ) || "" } mime_type={nft.content_type} />