From 55fff706cf740b5880d93a62fde4e4b8624548c4 Mon Sep 17 00:00:00 2001 From: Ben Kremer Date: Fri, 4 Feb 2022 14:01:32 +0100 Subject: [PATCH] fix: pass `accounts` to `getAccountBalances` --- dapps/react-dapp-v2/src/HooksApp.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dapps/react-dapp-v2/src/HooksApp.tsx b/dapps/react-dapp-v2/src/HooksApp.tsx index b922193..25cfe9f 100644 --- a/dapps/react-dapp-v2/src/HooksApp.tsx +++ b/dapps/react-dapp-v2/src/HooksApp.tsx @@ -237,7 +237,7 @@ export default function App() { const onSessionUpdate = async (accounts: string[], chains: string[]) => { setChains(chains); setAccounts(accounts); - await getAccountBalances(); + await getAccountBalances(accounts); }; const ping = async () => { @@ -274,11 +274,11 @@ export default function App() { } }; - const getAccountBalances = async () => { + const getAccountBalances = async (_accounts: string[]) => { setFetching(true); try { const arr = await Promise.all( - accounts.map(async account => { + _accounts.map(async account => { const [namespace, reference, address] = account.split(":"); const chainId = `${namespace}:${reference}`; const assets = await apiGetAccountAssets(address, chainId);