Skip to content
Merged
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
11 changes: 8 additions & 3 deletions src/app/(mobile-ui)/add-money/crypto/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type AddMoneyCryptoStep = 'sourceSelection' | 'tokenSelection' | 'networkSelecti
const AddMoneyCryptoPage = () => {
const router = useRouter()
const { address: peanutWalletAddress } = useWallet()
const [currentStep, setCurrentStep] = useState<AddMoneyCryptoStep>('sourceSelection')
const [selectedSource, setSelectedSource] = useState<CryptoSource | null>(null)
const [currentStep, setCurrentStep] = useState<AddMoneyCryptoStep>('tokenSelection') // hotfix for deposit - select tokenSelection view as default
const [selectedSource, setSelectedSource] = useState<CryptoSource | null>(CRYPTO_EXCHANGES[3]) // hotfix for deposit - select Other exhange by default
const [selectedToken, setSelectedToken] = useState<CryptoToken | null>(null)
const [selectedNetwork, setSelectedNetwork] = useState<SelectedNetwork | null>(null)
const [isRiskAccepted, setIsRiskAccepted] = useState(false)
Expand Down Expand Up @@ -51,6 +51,11 @@ const AddMoneyCryptoPage = () => {
}

const handleBackToSourceSelection = () => {
// hotfix for deposit - redirect to previous route if user is on tokenSelection and selected source is other-exchanges
if (selectedSource?.id === 'other-exchanges' && currentStep === 'tokenSelection') {
router.back()
return
}
setCurrentStep('sourceSelection')
setSelectedSource(null)
resetSelections()
Expand All @@ -69,7 +74,7 @@ const AddMoneyCryptoPage = () => {

const handleBackToNetworkSelectionFromQR = () => {
if (selectedSource?.type === 'exchange') {
setCurrentStep('sourceSelection')
setCurrentStep('tokenSelection') // hotfix for deposit - redirect to tokenSelection view if user is on qrScreen and selected source is exchange
} else {
setCurrentStep('networkSelection')
}
Expand Down
Loading