diff --git a/nym-wallet/src/hooks/useGetBalance.ts b/nym-wallet/src/hooks/useGetBalance.ts index a3c469b6c5..c226793e2d 100644 --- a/nym-wallet/src/hooks/useGetBalance.ts +++ b/nym-wallet/src/hooks/useGetBalance.ts @@ -251,7 +251,7 @@ export const useGetBalance = (clientDetails?: Account): TUseuserBalance => { } setIsLoading(true); setError(undefined); - void refreshBalances(); + refreshBalances().catch((e) => Console.error(String(e))); }, [clientDetails?.client_address]); return { diff --git a/nym-wallet/src/hooks/useNymUsdPrice.ts b/nym-wallet/src/hooks/useNymUsdPrice.ts index 4bfc05a2db..3a1f2afe07 100644 --- a/nym-wallet/src/hooks/useNymUsdPrice.ts +++ b/nym-wallet/src/hooks/useNymUsdPrice.ts @@ -29,9 +29,9 @@ export function useNymUsdPrice(network: Network | undefined): UseNymUsdPrice { return undefined; } - const cached = getCachedNymPrice(url); - if (cached) { - setUsdPerNym(cached.quotes.USD.price); + const cachedPrice = getCachedNymPrice(url); + if (cachedPrice) { + setUsdPerNym(cachedPrice.quotes.USD.price); setLoading(false); setError(undefined); return undefined; diff --git a/nym-wallet/src/pages/balance/Balance.tsx b/nym-wallet/src/pages/balance/Balance.tsx index 4427a93e69..26c561ac87 100644 --- a/nym-wallet/src/pages/balance/Balance.tsx +++ b/nym-wallet/src/pages/balance/Balance.tsx @@ -49,11 +49,7 @@ export const BalanceCard = ({ usdApproximationRow = ; } else if (usdApproxLabel) { usdApproximationRow = ( - + {`≈ ${usdApproxLabel}`} ); diff --git a/nym-wallet/src/pages/balance/NetworkOverviewSection.tsx b/nym-wallet/src/pages/balance/NetworkOverviewSection.tsx index 7034262770..645bd8496e 100644 --- a/nym-wallet/src/pages/balance/NetworkOverviewSection.tsx +++ b/nym-wallet/src/pages/balance/NetworkOverviewSection.tsx @@ -418,6 +418,24 @@ export const NetworkOverviewSection: React.FC = () => { ); }; + const delegationsCountBody = () => { + if (delegationsErr) { + return ( + + {delegationsErr} + + ); + } + if (delegationsCount !== undefined) { + return ( + + {formatCompactNumber(delegationsCount)} + + ); + } + return ; + }; + const showTrafficChartToggle = trafficChartData.length > 0; return ( @@ -539,17 +557,7 @@ export const NetworkOverviewSection: React.FC = () => { Number of delegations - {delegationsErr ? ( - - {delegationsErr} - - ) : delegationsCount !== undefined ? ( - - {formatCompactNumber(delegationsCount)} - - ) : ( - - )} + {delegationsCountBody()}