Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove metadata calls for holdings #1781

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/app/address/[principal]/TokenBalanceCard/FtAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ interface FtAvatarProps {
}

export function FtAvatar({ token, contractId }: FtAvatarProps) {
const { data: tokenMetadata } = useFtMetadata(contractId);
// const { data: tokenMetadata } = useFtMetadata(contractId);

const { asset } = getAssetNameParts(token);
return <TokenAvatar metadataImageUrl={tokenMetadata?.metadata?.cached_image} asset={asset} />;
return (
<TokenAvatar
metadataImageUrl={undefined /*tokenMetadata?.metadata?.cached_image*/}
asset={asset}
/>
);
}
13 changes: 9 additions & 4 deletions src/app/address/[principal]/TokenBalanceCard/NftAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ interface NftAvatarProps {
}

export function NftAvatar({ token, contractId, firstNftValue, asset }: NftAvatarProps) {
const { data: tokenMetadata } = useNftMetadata(
{ contractId, tokenId: Number(firstNftValue) },
{ enabled: !!firstNftValue, retry: 1, retryDelay: 2000 }
// const { data: tokenMetadata } = useNftMetadata(
// { contractId, tokenId: Number(firstNftValue) },
// { enabled: !!firstNftValue, retry: 1, retryDelay: 2000 }
// );
return (
<TokenAvatar
metadataImageUrl={undefined /*tokenMetadata?.metadata?.cached_image*/}
asset={asset}
/>
);
return <TokenAvatar metadataImageUrl={tokenMetadata?.metadata?.cached_image} asset={asset} />;
}
4 changes: 2 additions & 2 deletions src/common/components/balances/TokenAmount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ interface FtTokenAmountBaseProps {
contractId: string;
}
export function FtTokenAmountBase({ amount, contractId }: FtTokenAmountBaseProps) {
const { data: tokenMetadata } = useFtMetadata(contractId);
return <>{ftDecimals(amount, tokenMetadata?.decimals || 0)}</>;
// const { data: tokenMetadata } = useFtMetadata(contractId);
return <>{ftDecimals(amount, /*tokenMetadata?.decimals || */ 0)}</>;
}

export function FtTokenAmount(props: FtTokenAmountBaseProps) {
Expand Down
4 changes: 2 additions & 2 deletions src/common/components/balances/TokenSymbol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ export function FtTokenSymbol({
ftMetadata?: any;
contractId: string;
}) {
const { data: tokenMetadata } = useFtMetadata(contractId);
return <Caption>{tokenMetadata?.symbol || getTicker(asset).toUpperCase()}</Caption>;
// const { data: tokenMetadata } = useFtMetadata(contractId);
return <Caption>{/*tokenMetadata?.symbol || */ getTicker(asset).toUpperCase()}</Caption>;
}

export function NftTokenSymbol({ asset }: { asset: string }) {
Expand Down
Loading