A clear and concise description of what the bug is.
const { data, isLoading } = useBalance({ chainId: MyChainId, denom: MyDenom })
console.log(isLoading)
In case of a newly created wallet that has no balance, isLoading
is always true which makes it look like the balance is loading forever where instead there's actually no balance.
...
Steps to reproduce the behavior:
useBalance
isLoading
becomesfalse
to indicate the balance has been loaded.data
can continue to beundefined
to indicate there is no balance.
const { isLoading, data } = useBalances({ chainId: MyChainId, denom: MyDenom })
const balance = isLoading
? undefined
: (data && data.find((coin) => coin.denom === MyDenom)) || { denom: MyDenom, amount: '0' }
return {
data: balance,
isLoading
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too