Skip to content

Commit

Permalink
Account NFT loading fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bobo-k2 committed Jan 2, 2025
1 parent 556405d commit 74da54b
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/hooks/useAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,18 @@ export const useAccount = () => {
const avatarContractAddress = identity?.getAvatarContractAddress();
const avatarTokenId = identity?.getAvatarTokenId();
if (avatarContractAddress && avatarTokenId) {
nft = await nftRepository.getNftMetadata(
currentNetworkName.value.toLowerCase(),
avatarContractAddress,
avatarTokenId
);

if (nft) {
avatarUrl = getProxiedUrl(nft.image);
try {
nft = await nftRepository.getNftMetadata(
currentNetworkName.value.toLowerCase(),
avatarContractAddress,
avatarTokenId
);

if (nft) {
avatarUrl = getProxiedUrl(nft.image);
}
} catch (error) {
console.error('Unable to fetch nft metadata', error);
}
}

Expand Down

0 comments on commit 74da54b

Please sign in to comment.