From aad937c6fa75e05daa2183f1bb3a9bc00ae0f3c4 Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 6 Jun 2024 23:17:24 +1000 Subject: [PATCH] fix: unable to load dao tokens in dao app (#76) * fix: fallback to token API * chore: bump patch `0.18.5` -> `0.18.6` --- package.json | 2 +- src/lib/hooks/queries/useDaoAssetsCoins.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 785822f..5a5ab15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zero-tech/zapp-daos", - "version": "0.18.5", + "version": "0.18.6", "main": "dist/index.js", "repository": "git@github.com:zer0-os/zApp-DAOs.git", "scripts": { diff --git a/src/lib/hooks/queries/useDaoAssetsCoins.ts b/src/lib/hooks/queries/useDaoAssetsCoins.ts index 75cc371..6306b5f 100644 --- a/src/lib/hooks/queries/useDaoAssetsCoins.ts +++ b/src/lib/hooks/queries/useDaoAssetsCoins.ts @@ -14,13 +14,14 @@ export const useDaoAssetsCoins = (zna?: string) => { ['dao', 'assets', 'coins', { zna }], async () => { const response = await fetch( - `${safeUrl}/api/v1/safes/${dao.safeAddress}/balances/usd/?trusted=true&exclude_spam=true`, + `${safeUrl}/api/v1/safes/${dao.safeAddress}/balances/?trusted=true&exclude_spam=true`, ); const data = await response.json(); try { - if (!Number(data[0].fiatBalance ?? 1)) { + const hasFiatBalance = !!data[0]?.fiatBalance; + if (!hasFiatBalance) { const symbols = data.map((d) => { if (!d.token) return 'eth';