Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Wallet] Balances are not refreshed automatically #197

Open
bonomat opened this issue Jul 29, 2021 · 0 comments
Open

[Wallet] Balances are not refreshed automatically #197

bonomat opened this issue Jul 29, 2021 · 0 comments

Comments

@bonomat
Copy link
Member

bonomat commented Jul 29, 2021

The current implementation polls balances state only on reloading the UI or when triggered manually.

const walletStatusHook = useAsync({ promiseFn: getWalletStatus });
const walletBalanceHook = useAsync({ promiseFn: getBalances });
const swapToSignHook = useAsync({ promiseFn: getSwapToSign });
const loanToSignHook = useAsync({ promiseFn: getLoanToSign });
const openLoansHook = useAsync({ promiseFn: getOpenLoans });
let { data: walletStatus, reload: reloadWalletStatus, error } = walletStatusHook;
let { data: balanceUpdates, reload: reloadWalletBalances } = walletBalanceHook;
let { data: swapToSign, reload: reloadSwapToSign } = swapToSignHook;
let { data: loanToSign, reload: reloadLoanToSign } = loanToSignHook;
let { data: openLoans, reload: reloadOpenLoans } = openLoansHook;
const refreshAll = () => {
reloadWalletBalances();
reloadWalletStatus();
reloadSwapToSign();
reloadLoanToSign();
reloadOpenLoans();
};

Ideally this is refreshed automatically.

If this is done, we can remove some busy waits in the e2e tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant