Skip to content

Commit

Permalink
fix: resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
pkxro committed May 29, 2024
1 parent 9774785 commit 9f7de63
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions app/address/[address]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,21 +265,19 @@ function AccountHeader({ address, account, tokenInfo, isTokenInfoLoading }: { ad
}


// Checks the uri, if it's json, return the the json's image tag
if (tokenMetadata.uri.endsWith('.json')) {
fetch(tokenMetadata.uri)
.then(response => response.json())
.then(metadata => {
token.logoURI = metadata?.image || tokenMetadata.uri;
token.logoURI = metadata.image;
})
.catch(() => {
token.logoURI = tokenMetadata.uri;
console.error("Failed to resolve image from metadata pointer")
});
} else {
token.logoURI = tokenMetadata.uri;
token.logoURI = tokenMetadata.uri
}
}

}
// Fall back to legacy token list when there is stub metadata (blank uri), updatable by default by the mint authority
else if (!parsedData?.nftData?.metadata.data.uri && tokenInfo) {
token = tokenInfo;
Expand Down

0 comments on commit 9f7de63

Please sign in to comment.