Skip to content

Commit

Permalink
chore: use promise all
Browse files Browse the repository at this point in the history
  • Loading branch information
im-adithya committed Sep 25, 2024
1 parent e4c2e85 commit 5ffded0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/TransferFundsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { request } from "src/utils/request";
type TransferFundsButtonProps = {
channels: Channel[] | undefined;
albyBalance: AlbyBalance;
onTransferComplete: () => Promise<void>;
onTransferComplete: () => Promise<unknown>;
} & ButtonProps;

export function TransferFundsButton({
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/screens/channels/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,13 @@ export default function Channels() {
variant="outline"
channels={channels}
albyBalance={albyBalance}
onTransferComplete={async () => {
await reloadAlbyBalance();
await reloadBalances();
await reloadChannels();
}}
onTransferComplete={() =>
Promise.all([
reloadAlbyBalance(),
reloadBalances(),
reloadChannels(),
])
}
>
Migrate
</TransferFundsButton>
Expand Down
12 changes: 7 additions & 5 deletions frontend/src/screens/wallet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ function Wallet() {
<TransferFundsButton
channels={channels}
albyBalance={albyBalance}
onTransferComplete={async () => {
await reloadAlbyBalance();
await reloadBalances();
await reloadTransactions();
}}
onTransferComplete={() =>
Promise.all([
reloadAlbyBalance(),
reloadBalances(),
reloadTransactions(),
])
}
>
Migrate Funds
</TransferFundsButton>
Expand Down

0 comments on commit 5ffded0

Please sign in to comment.