summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-webextension/src/cta/Recovery/state.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Recovery/state.ts')
-rw-r--r--packages/taler-wallet-webextension/src/cta/Recovery/state.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/taler-wallet-webextension/src/cta/Recovery/state.ts b/packages/taler-wallet-webextension/src/cta/Recovery/state.ts
index 078e53bf9..9731d3f69 100644
--- a/packages/taler-wallet-webextension/src/cta/Recovery/state.ts
+++ b/packages/taler-wallet-webextension/src/cta/Recovery/state.ts
@@ -16,7 +16,7 @@
import { parseRecoveryUri } from "@gnu-taler/taler-util";
import { WalletApiOperation } from "@gnu-taler/taler-wallet-core";
-import { Alert } from "../../context/alert.js";
+import { useAlertContext } from "../../context/alert.js";
import { useBackendContext } from "../../context/backend.js";
import { useTranslationContext } from "../../context/translation.js";
import { Props, State } from "./index.js";
@@ -27,6 +27,7 @@ export function useComponentState({
onSuccess,
}: Props): State {
const api = useBackendContext();
+ const { pushAlertOnError } = useAlertContext();
const { i18n } = useTranslationContext();
if (!talerRecoveryUri) {
return {
@@ -67,10 +68,10 @@ export function useComponentState({
status: "ready",
accept: {
- onClick: recoverBackup,
+ onClick: pushAlertOnError(recoverBackup),
},
cancel: {
- onClick: onCancel,
+ onClick: pushAlertOnError(onCancel),
},
error: undefined,
};