Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/app/(mobile-ui)/withdraw/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<WithdrawStep>(initialStep)

Expand Down Expand Up @@ -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 (
<div className="flex min-h-[inherit] flex-col justify-start space-y-8">
<NavHeader
Expand Down
25 changes: 10 additions & 15 deletions src/components/AddWithdraw/AddWithdrawRouterView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,18 @@ export const AddWithdrawRouterView: FC<AddWithdrawRouterViewProps> = ({
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)}
/>
Expand Down
Loading