Skip to content

Commit

Permalink
Merge pull request #7517 from hassnian/issue-7499
Browse files Browse the repository at this point in the history
  • Loading branch information
yangwao authored Oct 10, 2023
2 parents 0615c18 + cbb5eb5 commit 834cec1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/gallery/useGalleryItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}
})

Expand Down

0 comments on commit 834cec1

Please sign in to comment.