aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/popup
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-03-11 11:14:27 -0300
committerSebastian <sebasjm@gmail.com>2022-03-11 11:15:07 -0300
commitab68ecc7332281a43ce4acf28302f85a3c8f401a (patch)
treedc449a317f5a777788918eac381089af2fdda5d9 /packages/taler-wallet-webextension/src/popup
parent9337734a245001f40fe8033e11f2df062fd7560b (diff)
downloadwallet-core-ab68ecc7332281a43ce4acf28302f85a3c8f401a.tar.xz
pending transaction, finally!
Diffstat (limited to 'packages/taler-wallet-webextension/src/popup')
-rw-r--r--packages/taler-wallet-webextension/src/popup/BalancePage.tsx24
1 files changed, 4 insertions, 20 deletions
diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx
index e85c00d60..53b4e1518 100644
--- a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx
+++ b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx
@@ -28,7 +28,6 @@ import { JustInDevMode } from "../components/JustInDevMode";
import { Loading } from "../components/Loading";
import { LoadingError } from "../components/LoadingError";
import { MultiActionButton } from "../components/MultiActionButton";
-import PendingTransactions from "../components/PendingTransactions";
import { ButtonBoxPrimary, ButtonPrimary } from "../components/styled";
import { useAsyncAsHook } from "../hooks/useAsyncAsHook";
import { AddNewActionView } from "../wallet/AddNewActionView";
@@ -46,19 +45,10 @@ export function BalancePage({
goToWalletHistory,
}: Props): VNode {
const [addingAction, setAddingAction] = useState(false);
- const state = useAsyncAsHook(
- async () => ({
- balance: await wxApi.getBalance(),
- pending: await wxApi.getTransactions(),
- }),
- [NotificationType.WithdrawGroupFinished],
- );
- const balances =
- !state || state.hasError ? [] : state.response.balance.balances;
- const pending =
- !state || state.hasError
- ? []
- : state.response.pending.transactions.filter((t) => t.pending);
+ const state = useAsyncAsHook(wxApi.getBalance, [
+ NotificationType.WithdrawGroupFinished,
+ ]);
+ const balances = !state || state.hasError ? [] : state.response.balances;
if (!state) {
return <Loading />;
@@ -80,7 +70,6 @@ export function BalancePage({
return (
<BalanceView
balances={balances}
- pending={pending}
goToWalletManualWithdraw={goToWalletManualWithdraw}
goToWalletDeposit={goToWalletDeposit}
goToWalletHistory={goToWalletHistory}
@@ -90,7 +79,6 @@ export function BalancePage({
}
export interface BalanceViewProps {
balances: Balance[];
- pending: Transaction[];
goToWalletManualWithdraw: () => void;
goToAddAction: () => void;
goToWalletDeposit: (currency: string) => void;
@@ -99,7 +87,6 @@ export interface BalanceViewProps {
export function BalanceView({
balances,
- pending,
goToWalletManualWithdraw,
goToWalletDeposit,
goToWalletHistory,
@@ -117,9 +104,6 @@ export function BalanceView({
return (
<Fragment>
- {/* {pending.length > 0 ? (
- <PendingTransactions transactions={pending} />
- ) : undefined} */}
<section>
<BalanceTable
balances={balances}