From 6dcc73ba974e9059c4f4c25761b7fda959bef1c9 Mon Sep 17 00:00:00 2001 From: Brooks Boyd Date: Tue, 14 Nov 2023 22:25:46 -0600 Subject: [PATCH] Catch any falsy value --- src/hooks/useGetSourceParsedTokenAccounts.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hooks/useGetSourceParsedTokenAccounts.ts b/src/hooks/useGetSourceParsedTokenAccounts.ts index eae9f86de..f635dff3d 100644 --- a/src/hooks/useGetSourceParsedTokenAccounts.ts +++ b/src/hooks/useGetSourceParsedTokenAccounts.ts @@ -640,14 +640,13 @@ const createNFTParsedTokenAccountFromCovalent = ( covalent: CovalentData, nft_data: CovalentNFTData ): NFTParsedTokenAccount => { - const amount = - nft_data.token_balance == null - ? "0" - : formatUnits(nft_data.token_balance, covalent.contract_decimals); + const amount = nft_data.token_balance + ? formatUnits(nft_data.token_balance, covalent.contract_decimals) + : "0"; return { publicKey: walletAddress, mintKey: covalent.contract_address, - amount: nft_data.token_balance == null ? "" : nft_data.token_balance, + amount: nft_data.token_balance ? nft_data.token_balance : "", decimals: covalent.contract_decimals, uiAmount: Number(amount), uiAmountString: amount,