Skip to content

Commit

Permalink
Account NFT loading fix (#1434)
Browse files Browse the repository at this point in the history
* Account NFT loading fix

* Comment out NFT fetching
  • Loading branch information
bobo-k2 authored Jan 3, 2025
1 parent 556405d commit f1ee4f4
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/hooks/useAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,30 @@ export const useAccount = () => {

if (mapped) {
const identityRepository = container.get<IdentityRepository>(Symbols.IdentityRepository);
const nftRepository = container.get<INftRepository>(Symbols.NftRepository);
// const nftRepository = container.get<INftRepository>(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) {
nft = await nftRepository.getNftMetadata(
currentNetworkName.value.toLowerCase(),
avatarContractAddress,
avatarTokenId
);

if (nft) {
avatarUrl = getProxiedUrl(nft.image);
}
}
// 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);
// }
// }

const account: UnifiedAccount = {
nativeAddress: isEvmAddress ? mapped : address,
Expand Down

0 comments on commit f1ee4f4

Please sign in to comment.