From 32fd8fe021f790d1974518649d1573b147ddb356 Mon Sep 17 00:00:00 2001 From: daniel-vahn Date: Fri, 26 Apr 2024 09:49:03 +0200 Subject: [PATCH] Refactor getAccountAndBalance to use async/await --- src/App.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index b67ee4f..2512eea 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -66,9 +66,9 @@ function App() { const [account, setAccount] = useState(null); const [balance, setBalance] = useState(null); - const getAccountAndBalance = () => { + const getAccountAndBalance = async () => { const providerId = window.localStorage.getItem('providerId'); - axios + await axios .get(BRIDGE_URL + '/accounts/' + providerId, { withCredentials: true, headers: { @@ -82,7 +82,7 @@ function App() { setAccount(response.data.accounts[0]); }); - axios + await axios .get(BRIDGE_URL + '/balance/' + account, { withCredentials: true, headers: {