diff options
author | Sebastian <sebasjm@gmail.com> | 2024-02-23 08:30:43 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-02-23 08:30:43 -0300 |
commit | 73e36c99037cef1ccc43bb80b67b19e0f44326fd (patch) | |
tree | c076b0084a3fb5004b8f3ffa32cc09a9b1a42d22 /packages/demobank-ui/src/pages/SolveChallengePage.tsx | |
parent | 271488f041890391e1c6d946fd1aef00c2113fd0 (diff) | |
download | wallet-core-73e36c99037cef1ccc43bb80b67b19e0f44326fd.tar.xz |
return to form after 2fa cancelled
Diffstat (limited to 'packages/demobank-ui/src/pages/SolveChallengePage.tsx')
-rw-r--r-- | packages/demobank-ui/src/pages/SolveChallengePage.tsx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/demobank-ui/src/pages/SolveChallengePage.tsx b/packages/demobank-ui/src/pages/SolveChallengePage.tsx index 5ac622795..b7fc82a94 100644 --- a/packages/demobank-ui/src/pages/SolveChallengePage.tsx +++ b/packages/demobank-ui/src/pages/SolveChallengePage.tsx @@ -46,13 +46,14 @@ import { RouteDefinition } from "../route.js"; import { undefinedIfEmpty } from "../utils.js"; import { RenderAmount } from "./PaytoWireTransferForm.js"; import { OperationNotFound } from "./WithdrawalQRCode.js"; +import { useNavigationContext } from "../context/navigation.js"; export function SolveChallengePage({ onChallengeCompleted, routeClose, }: { onChallengeCompleted: () => void; - routeClose: RouteDefinition<Record<string, never>>; + routeClose: RouteDefinition; }): VNode { const { api } = useBankCoreApiContext(); const { i18n } = useTranslationContext(); @@ -61,6 +62,7 @@ export function SolveChallengePage({ const [notification, notify, handleError] = useLocalNotification(); const { state } = useBackendState(); const creds = state.status !== "loggedIn" ? undefined : state; + const { navigateTo } = useNavigationContext(); if (!bankState.currentChallenge) { return ( @@ -209,6 +211,7 @@ export function SolveChallengePage({ updateBankState("currentChallenge", { operation: ch.operation, id: String(resp.body.challenge_id), + location: ch.location, sent: AbsoluteTime.never(), request: ch.request, }); @@ -262,7 +265,7 @@ export function SolveChallengePage({ onStart={startChallenge} onCancel={() => { updateBankState("currentChallenge", undefined); - onChallengeCompleted(); + navigateTo(ch.location) }} /> {ch.info && ( @@ -304,7 +307,7 @@ export function SolveChallengePage({ </div> </div> <div class="flex items-center justify-between border-gray-900/10 px-4 py-4 "> - <div /> + <div /> <button type="submit" name="confirm" @@ -344,7 +347,7 @@ function ChallengeDetails({ if (firstTime) { onStart() } - },[]) + }, []) return ( <div class="px-4 mt-4 "> <div class="w-full"> |