From ab68ecc7332281a43ce4acf28302f85a3c8f401a Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 11 Mar 2022 11:14:27 -0300 Subject: pending transaction, finally! --- .../src/popup/BalancePage.tsx | 24 ++++------------------ 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'packages/taler-wallet-webextension/src/popup') 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 ; @@ -80,7 +70,6 @@ export function BalancePage({ return ( 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 ( - {/* {pending.length > 0 ? ( - - ) : undefined} */}