From dc16c5714885848c5c626aeccd6e86f31cc7e0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Ram=C3=ADrez?= Date: Fri, 3 Oct 2025 16:54:39 -0300 Subject: [PATCH] fix: correct recent method routing --- src/app/(mobile-ui)/withdraw/page.tsx | 4 +-- .../AddWithdraw/AddWithdrawRouterView.tsx | 25 ++++++++----------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/app/(mobile-ui)/withdraw/page.tsx b/src/app/(mobile-ui)/withdraw/page.tsx index ed7ef7959..0f4a94dd4 100644 --- a/src/app/(mobile-ui)/withdraw/page.tsx +++ b/src/app/(mobile-ui)/withdraw/page.tsx @@ -33,7 +33,7 @@ export default function WithdrawPage() { setShowAllWithdrawMethods, } = useWithdrawFlow() - const initialStep: WithdrawStep = selectedMethod || selectedBankAccount ? 'inputAmount' : 'selectMethod' + const initialStep: WithdrawStep = selectedMethod ? 'inputAmount' : 'selectMethod' const [step, setStep] = useState(initialStep) @@ -218,8 +218,6 @@ export default function WithdrawPage() { }, [rawTokenAmount, maxDecimalAmount, error.showError, selectedTokenData?.price]) if (step === 'inputAmount') { - const methodTitle = selectedMethod?.title || selectedMethod?.countryPath || 'Selected method' - return (
= ({ pageTitle={pageTitle} onPrev={onBackClick || defaultBackNavigation} savedAccounts={savedAccounts} - onAccountClick={(account, path) => { + onAccountClick={(account, _path) => { setSelectedBankAccount(account) - - // FIXED: For withdraw flow, route to saved account path - if (flow === 'withdraw') { - if (account.type === AccountType.MANTECA) { - router.push( - `/withdraw/manteca?country=${account.details.countryName}&destination=${account.identifier}` - ) - } else { - router.push(path) - } - return + setSelectedMethod({ + type: account.type === AccountType.MANTECA ? 'manteca' : 'bridge', + countryPath: account.details.countryName, + title: 'To Bank', + }) + if (account.type === AccountType.MANTECA) { + router.push( + `/withdraw/manteca?country=${account.details.countryName}&destination=${account.identifier}` + ) } - - // Original add flow - router.push(path) }} onSelectNewMethodClick={() => setShouldShowAllMethods(true)} />