From 74da54b2bd6982b827a96f9c82dace0a5baad587 Mon Sep 17 00:00:00 2001 From: Bobo Date: Thu, 2 Jan 2025 14:47:22 +0100 Subject: [PATCH 1/2] Account NFT loading fix --- src/hooks/useAccount.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/hooks/useAccount.ts b/src/hooks/useAccount.ts index 27a6e7ee1..1a45426c2 100644 --- a/src/hooks/useAccount.ts +++ b/src/hooks/useAccount.ts @@ -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); } } From 68055f745cd56c813ba8a190eaf344460b06ca6c Mon Sep 17 00:00:00 2001 From: Bobo Date: Thu, 2 Jan 2025 15:15:54 +0100 Subject: [PATCH 2/2] Comment out NFT fetching --- src/hooks/useAccount.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/hooks/useAccount.ts b/src/hooks/useAccount.ts index 1a45426c2..42652c15c 100644 --- a/src/hooks/useAccount.ts +++ b/src/hooks/useAccount.ts @@ -104,30 +104,30 @@ export const useAccount = () => { if (mapped) { const identityRepository = container.get(Symbols.IdentityRepository); - const nftRepository = container.get(Symbols.NftRepository); + // const nftRepository = container.get(Symbols.NftRepository); const identity = await identityRepository.getIdentity(isEvmAddress ? mapped : address); const name = identity?.display || ''; let avatarUrl: string | undefined; let nft: NftMetadata | undefined; - const avatarContractAddress = identity?.getAvatarContractAddress(); - const avatarTokenId = identity?.getAvatarTokenId(); - if (avatarContractAddress && avatarTokenId) { - try { - nft = await nftRepository.getNftMetadata( - currentNetworkName.value.toLowerCase(), - avatarContractAddress, - avatarTokenId - ); + // const avatarContractAddress = identity?.getAvatarContractAddress(); + // const avatarTokenId = identity?.getAvatarTokenId(); + // if (avatarContractAddress && avatarTokenId) { + // 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); - } - } + // if (nft) { + // avatarUrl = getProxiedUrl(nft.image); + // } + // } catch (error) { + // console.error('Unable to fetch nft metadata', error); + // } + // } const account: UnifiedAccount = { nativeAddress: isEvmAddress ? mapped : address,