fix: nft ipfs link

This commit is contained in:
DIYgod 2023-08-07 01:07:18 +01:00
parent 9ea11e0e26
commit 7f9f3648cb
No known key found for this signature in database
1 changed files with 5 additions and 1 deletions

View File

@ -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}
/>