[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: fix: update total balance on
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: fix: update total balance on wallet page when WithdrawGroupFinished |
Date: |
Tue, 15 Mar 2022 14:35:10 +0100 |
This is an automated email from the git hooks/post-receive script.
sebasjm pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new ae775d4b fix: update total balance on wallet page when
WithdrawGroupFinished
ae775d4b is described below
commit ae775d4b00011874ac13f2a9fdf96e99b547f977
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Tue Mar 15 10:35:00 2022 -0300
fix: update total balance on wallet page when WithdrawGroupFinished
---
.../src/wallet/History.tsx | 25 +++++++++++-----------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/packages/taler-wallet-webextension/src/wallet/History.tsx
b/packages/taler-wallet-webextension/src/wallet/History.tsx
index ea6057d0..02fc0a76 100644
--- a/packages/taler-wallet-webextension/src/wallet/History.tsx
+++ b/packages/taler-wallet-webextension/src/wallet/History.tsx
@@ -52,20 +52,19 @@ export function HistoryPage({
goToWalletDeposit,
}: Props): VNode {
const { i18n } = useTranslationContext();
- const balance = useAsyncAsHook(wxApi.getBalance);
- const balanceWithoutError = balance?.hasError
- ? []
- : balance?.response.balances || [];
-
- const transactionQuery = useAsyncAsHook(wxApi.getTransactions, [
- NotificationType.WithdrawGroupFinished,
- ]);
+ const state = useAsyncAsHook(
+ async () => ({
+ b: await wxApi.getBalance(),
+ tx: await wxApi.getTransactions(),
+ }),
+ [NotificationType.WithdrawGroupFinished],
+ );
- if (!transactionQuery || !balance) {
+ if (!state) {
return <Loading />;
}
- if (transactionQuery.hasError) {
+ if (state.hasError) {
return (
<LoadingError
title={
@@ -73,18 +72,18 @@ export function HistoryPage({
Could not load the list of transactions
</i18n.Translate>
}
- error={transactionQuery}
+ error={state}
/>
);
}
return (
<HistoryView
- balances={balanceWithoutError}
+ balances={state.response.b.balances}
defaultCurrency={currency}
goToWalletManualWithdraw={goToWalletManualWithdraw}
goToWalletDeposit={goToWalletDeposit}
- transactions={[...transactionQuery.response.transactions].reverse()}
+ transactions={[...state.response.tx.transactions].reverse()}
/>
);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: fix: update total balance on wallet page when WithdrawGroupFinished,
gnunet <=