Skip to content

Commit

Permalink
Refactor getAccountAndBalance to use async/await
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-vahn committed Apr 26, 2024
1 parent fb4a4a6 commit 32fd8fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ function App() {
const [account, setAccount] = useState<string | null>(null);
const [balance, setBalance] = useState<string | null>(null);

const getAccountAndBalance = () => {
const getAccountAndBalance = async () => {
const providerId = window.localStorage.getItem('providerId');
axios
await axios
.get(BRIDGE_URL + '/accounts/' + providerId, {
withCredentials: true,
headers: {
Expand All @@ -82,7 +82,7 @@ function App() {
setAccount(response.data.accounts[0]);
});

axios
await axios
.get(BRIDGE_URL + '/balance/' + account, {
withCredentials: true,
headers: {
Expand Down

0 comments on commit 32fd8fe

Please sign in to comment.