diff options
Diffstat (limited to 'packages/taler-wallet-webextension/src/cta/Recovery')
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Recovery/state.ts | 7 | ||||
-rw-r--r-- | packages/taler-wallet-webextension/src/cta/Recovery/stories.tsx | 2 |
2 files changed, 5 insertions, 4 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, }; diff --git a/packages/taler-wallet-webextension/src/cta/Recovery/stories.tsx b/packages/taler-wallet-webextension/src/cta/Recovery/stories.tsx index 9243cc015..4f7a14c6d 100644 --- a/packages/taler-wallet-webextension/src/cta/Recovery/stories.tsx +++ b/packages/taler-wallet-webextension/src/cta/Recovery/stories.tsx @@ -20,7 +20,7 @@ */ import { Amounts } from "@gnu-taler/taler-util"; -import { createExample } from "../../test-utils.js"; +import { tests } from "@gnu-taler/web-util/lib/index.browser"; import { ReadyView } from "./views.js"; export default { |