diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/popup/BalancePage.tsx')
-rw-r--r-- | packages/taler-wallet-webextension/src/popup/BalancePage.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx index 96f0f6dd9..87767d008 100644 --- a/packages/taler-wallet-webextension/src/popup/BalancePage.tsx +++ b/packages/taler-wallet-webextension/src/popup/BalancePage.tsx @@ -22,7 +22,11 @@ import { BalanceTable } from "../components/BalanceTable.js"; import { ErrorAlertView } from "../components/CurrentAlerts.js"; import { Loading } from "../components/Loading.js"; import { MultiActionButton } from "../components/MultiActionButton.js"; -import { alertFromError, ErrorAlert } from "../context/alert.js"; +import { + alertFromError, + ErrorAlert, + useAlertContext, +} from "../context/alert.js"; import { useBackendContext } from "../context/backend.js"; import { useTranslationContext } from "../context/translation.js"; import { useAsyncAsHook } from "../hooks/useAsyncAsHook.js"; @@ -75,6 +79,7 @@ function useComponentState({ }: Props): State { const api = useBackendContext(); const { i18n } = useTranslationContext(); + const { pushAlertOnError } = useAlertContext(); const [addingAction, setAddingAction] = useState(false); const state = useAsyncAsHook(() => api.wallet.call(WalletApiOperation.GetBalances, {}), @@ -104,7 +109,7 @@ function useComponentState({ status: "action", error: undefined, cancel: { - onClick: async () => setAddingAction(false), + onClick: pushAlertOnError(async () => setAddingAction(false)), }, }; } @@ -113,10 +118,10 @@ function useComponentState({ error: undefined, balances: state.response.balances, addAction: { - onClick: async () => setAddingAction(true), + onClick: pushAlertOnError(async () => setAddingAction(true)), }, goToWalletManualWithdraw: { - onClick: goToWalletManualWithdraw, + onClick: pushAlertOnError(goToWalletManualWithdraw), }, goToWalletDeposit, goToWalletHistory, |