From 44820f06be979d3a30d2e66c430e212e28ca6052 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Wed, 10 Jan 2024 14:44:10 -0300
Subject: save challenge id when 2fa is required

---
 packages/demobank-ui/src/pages/WithdrawalOperationPage.tsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'packages/demobank-ui/src/pages/WithdrawalOperationPage.tsx')

diff --git a/packages/demobank-ui/src/pages/WithdrawalOperationPage.tsx b/packages/demobank-ui/src/pages/WithdrawalOperationPage.tsx
index 7060b7a98..4bb3b4d7b 100644
--- a/packages/demobank-ui/src/pages/WithdrawalOperationPage.tsx
+++ b/packages/demobank-ui/src/pages/WithdrawalOperationPage.tsx
@@ -20,12 +20,12 @@ import {
   stringifyWithdrawUri
 } from "@gnu-taler/taler-util";
 import {
+  Attention,
   useTranslationContext
 } from "@gnu-taler/web-util/browser";
 import { Fragment, VNode, h } from "preact";
-import { Attention } from "@gnu-taler/web-util/browser";
 import { useBankCoreApiContext } from "../context/config.js";
-import { usePreferences } from "../hooks/preferences.js";
+import { useBankState } from "../hooks/bank-state.js";
 import { WithdrawalQRCode } from "./WithdrawalQRCode.js";
 
 const logger = new Logger("AccountPage");
@@ -44,7 +44,8 @@ export function WithdrawalOperationPage({
   });
   const parsedUri = parseWithdrawUri(uri);
   const { i18n } = useTranslationContext();
-  const [settings, updateSettings] = usePreferences();
+  const [, updateBankState] = useBankState();
+
 
   if (!parsedUri) {
     return <Attention type="danger" title={i18n.str`The Withdrawal URI is not valid`}>
@@ -56,7 +57,7 @@ export function WithdrawalOperationPage({
     <WithdrawalQRCode
       withdrawUri={parsedUri}
       onClose={() => {
-        updateSettings("currentWithdrawalOperationId", undefined)
+        updateBankState("currentWithdrawalOperationId", undefined)
         onContinue()
       }}
     />
-- 
cgit v1.2.3

