From 340f79b6295ca77b80c58c8873bc1ec047fb299c Mon Sep 17 00:00:00 2001 From: chaojun Date: Mon, 4 Nov 2024 15:51:47 +0800 Subject: [PATCH] Update, #5008 --- .../hooks/usePostCommentsFilteredData.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/next-common/hooks/usePostCommentsFilteredData.js b/packages/next-common/hooks/usePostCommentsFilteredData.js index b6154cdc9a..247ac80127 100644 --- a/packages/next-common/hooks/usePostCommentsFilteredData.js +++ b/packages/next-common/hooks/usePostCommentsFilteredData.js @@ -55,20 +55,20 @@ export function usePostCommentsFilteredData() { ).toNumber(); // merge balance - try { - if (api) { - if (address) { - const normalizedAddress = normalizeAddress(address); + if (api) { + if (address) { + const normalizedAddress = normalizeAddress(address); + try { item.balance = await getAddressVotingBalance( api, normalizedAddress, ); - } else { - item.balance = 0; + } catch (e) { + console.error(e); } + } else { + item.balance = 0; } - } catch (e) { - console.error(e); } return item;