Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkao committed Oct 31, 2024
1 parent c7ed909 commit 59ee69f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/widget-v2/src/hooks/useGetSourceBalance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export const useGetSourceBalance = () => {
const sourceBalance = skipBalances?.chains?.[chainID]?.denoms?.[denom];

if (denomsExists && sourceBalance === undefined) {
return null;
return {
amount: 0,
formattedAmount: "0",
error: undefined,
};
}
return skipBalances?.chains?.[chainID]?.denoms?.[denom];
}, [sourceAsset, sourceAccount, skipBalances]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const ConnectedWalletContent = () => {
const symbol = sourceDetails?.symbol ? sourceDetails?.symbol : "";
if (sourceBalance?.error?.message) return "--";
if (sourceBalance === undefined) return;
if (sourceBalance === null) return `0 ${symbol}`;

const amount = sourceBalance?.amount;
let formattedBalanceAmount = sourceBalance?.formattedAmount;
Expand Down

0 comments on commit 59ee69f

Please sign in to comment.