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/PaymentOptions.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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

diff --git a/packages/demobank-ui/src/pages/PaymentOptions.tsx b/packages/demobank-ui/src/pages/PaymentOptions.tsx
index bbe33eb57..1a431a939 100644
--- a/packages/demobank-ui/src/pages/PaymentOptions.tsx
+++ b/packages/demobank-ui/src/pages/PaymentOptions.tsx
@@ -21,6 +21,7 @@ import { useState } from "preact/hooks";
 import { PaytoWireTransferForm, doAutoFocus } from "./PaytoWireTransferForm.js";
 import { WalletWithdrawForm } from "./WalletWithdrawForm.js";
 import { usePreferences } from "../hooks/preferences.js";
+import { useBankState } from "../hooks/bank-state.js";
 
 /**
  * Let the user choose a payment option,
@@ -28,7 +29,7 @@ import { usePreferences } from "../hooks/preferences.js";
  */
 export function PaymentOptions({ limit, goToConfirmOperation }: { limit: AmountJson, goToConfirmOperation: (id: string) => void }): VNode {
   const { i18n } = useTranslationContext();
-  const [settings] = usePreferences();
+  const [bankState] = useBankState();
 
   const [tab, setTab] = useState<"charge-wallet" | "wire-transfer" | undefined>();
 
@@ -59,7 +60,7 @@ export function PaymentOptions({ limit, goToConfirmOperation }: { limit: AmountJ
               <div class="mt-1 flex items-center text-sm text-gray-500">
                 <i18n.Translate>Withdraw digital money into your mobile wallet or browser extension</i18n.Translate>
               </div>
-              {!!settings.currentWithdrawalOperationId &&
+              {!!bankState.currentWithdrawalOperationId &&
                 <span class="flex items-center gap-x-1.5 w-fit rounded-md bg-green-100 px-2 py-1 text-xs font-medium text-green-700 whitespace-pre">
                   <svg class="h-1.5 w-1.5 fill-green-500" viewBox="0 0 6 6" aria-hidden="true">
                     <circle cx="3" cy="3" r="3" />
-- 
cgit v1.2.3

