Skip to content

Commit 1884e7d

Browse files
authored
Merge pull request #38 from syscoin/develop
fix(balance): incorrect sysx balance
2 parents 712d4b0 + e750de9 commit 1884e7d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utils/balance-hooks.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ export const useUtxoBalance = (
3636
const balanceInText = await fetch(url)
3737
.then((res) => res.json())
3838
.then((res: BalanceResp) => {
39-
if (assetGuid && address && res.tokensAsset) {
39+
if (assetGuid && address) {
40+
if (!res.tokensAsset) {
41+
return "0";
42+
}
4043
const total = res.tokensAsset.reduce((acc, asset) => {
4144
if (asset.assetGuid === assetGuid) {
4245
return acc + parseInt(asset.balance);

0 commit comments

Comments
 (0)