diff --git a/components/gallery/useGalleryItem.ts b/components/gallery/useGalleryItem.ts index 2ceb4f4a3a..ecc85273f1 100644 --- a/components/gallery/useGalleryItem.ts +++ b/components/gallery/useGalleryItem.ts @@ -92,18 +92,24 @@ export const useGalleryItem = (nftId?: string): GalleryItem => { nft.value = nftEntity - const resources = nftEntity.resources?.map((resource) => { + const resources = nftEntity.resources?.map((resource, index) => { const imageSrc = resource.meta?.animationUrl || resource.src || resource.meta?.image || resource.thumb + let animationUrl = resource.meta?.animationUrl + + if (index === 0 && !animationUrl) { + animationUrl = nftEntity.meta.animation_url + } + return { ...resource, src: sanitizeIpfsUrl(imageSrc), thumb: sanitizeIpfsUrl(resource.thumb || resource.meta?.image), - animation: sanitizeIpfsUrl(resource.meta?.animationUrl), + animation: sanitizeIpfsUrl(animationUrl), } })