Skip to content

Commit

Permalink
fix(withdraw): return correctly to first step on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Mar 19, 2024
1 parent cf80a0b commit d7e1433
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ jobs:

- name: Get node version
id: node
run: |
echo "::set-output name=version::$(node -v)"
run: echo "version=$(node -v)" >> "$GITHUB_OUTPUT"

- name: Get node_modules cache
uses: actions/cache@v4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,20 @@ import { destroy } from 'redux-form'
import { Button, Icon, Text } from 'blockchain-info-components'
import FlyoutFooter from 'components/Flyout/Footer'
import { modals } from 'data/actions'
import { setDWStep } from 'data/components/brokerage/slice'
import { getModals } from 'data/modals/selectors'
import { BankDWStepType, ModalName } from 'data/types'
import { ModalName } from 'data/types'

import { Header } from '../Header'
import { WIRE_BANK_FORM } from './constants'
import { FinalStatusWrapper } from './StepsStyles'
import { getFiatCurrency } from 'data/components/brokerage/selectors'

const Failure = ({ message, title }: { message?: string; title?: string }) => {
const dispatch = useDispatch()
const openModals = useSelector(getModals)

const onConfirm = () => {
dispatch(destroy(WIRE_BANK_FORM))
if (openModals.find((m) => m.props.origin === 'AddBankModalSettings')) {
dispatch(modals.closeModal(ModalName.BANK_DEPOSIT_MODAL))
} else {
dispatch(setDWStep({ dwStep: BankDWStepType.DEPOSIT_METHODS }))
}
dispatch(modals.closeModal(ModalName.BANK_DEPOSIT_MODAL))
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ import { destroy } from 'redux-form'
import { WalletFiatType } from '@core/types'
import { Button, Icon, Text } from 'blockchain-info-components'
import FlyoutFooter from 'components/Flyout/Footer'
import { components, modals } from 'data/actions'
import { modals } from 'data/actions'
import { getModals } from 'data/modals/selectors'
import { ModalName, WithdrawStepEnum } from 'data/types'

import { Header } from '../Header'
import { WIRE_BANK_FORM } from './constants'
import { FinalStatusWrapper } from './StepsStyles'
import { withdraw } from 'data/components/actions'

type Props = { bankName: string; fiatCurrency: WalletFiatType }

Expand All @@ -25,7 +26,7 @@ const Success = ({ bankName, fiatCurrency }: Props) => {

if (!openModals.find((m) => m.props.origin === 'AddBankModalSettings')) {
dispatch(
components.withdraw.setStep({
withdraw.setStep({
fiatCurrency,
step: WithdrawStepEnum.BANK_PICKER
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { useEffect } from 'react'
import { useDispatch, useSelector } from 'react-redux'

import { BeneficiariesType, BSPaymentMethodsType } from '@core/types'
import { custodial } from 'data/actions'
import { brokerage, buySell } from 'data/components/actions'
import { getFiatCurrency } from 'data/components/withdraw/selectors'
Expand All @@ -11,11 +10,6 @@ import { getData } from './selectors'
import Loading from './template.loading'
import Success from './template.success'

type DataType = {
beneficiaries: BeneficiariesType
paymentMethods: BSPaymentMethodsType
}

const LinkedWireBanks = () => {
const { data, hasError, isLoading, isNotAsked } = useRemote(getData)
const fiatCurrency = useSelector(getFiatCurrency)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import { lift } from 'ramda'

import {
BeneficiariesType,
BSPaymentMethodsType,
ExtractSuccess,
RemoteDataType
} from '@core/types'
import { BeneficiariesType, BSPaymentMethodsType, RemoteDataType } from '@core/types'
import { selectors } from 'data'
import { RootState } from 'data/rootReducer'

Expand Down

0 comments on commit d7e1433

Please sign in to comment.