Skip to content

Commit

Permalink
fix(wires): show old wire form for non-us users on withdraw (#6301)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Feb 23, 2024
1 parent fd08033 commit 743052b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ const WithdrawalMethods: Props = ({ fiatCurrency, handleClose }) => {
// TODO: implement Withdrawal version of wire instructions so we
// have more control over look/feel/interactions instead of piggy packing
// off of the deposit wire instructions

const isUserFromUS = data?.userCountryCode === 'US'

dispatch(
actions.components.brokerage.setDWStep({
dwStep: BankDWStepType.ADD_WIRE_BANK
dwStep: isUserFromUS ? BankDWStepType.ADD_WIRE_BANK : BankDWStepType.WIRE_INSTRUCTIONS
})
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { RootState } from 'data/rootReducer'

type SuccessStateType = {
paymentMethods: BSPaymentMethodsType
userCountryCode: string
userTier: TIER_TYPES
}

Expand All @@ -18,20 +19,22 @@ const getData = (state: RootState): RemoteDataType<string, SuccessStateType> =>
} as InvitationsType)

const userTier = selectors.modules.profile.getCurrentTier(state)
const userCountryCode = selectors.modules.profile.getUserCountryCode(state)

const filterPaymentMethods = (methods) => {
return methods.filter((m) => m.type === BSPaymentTypes.BANK_ACCOUNT || m.currency === 'USD')
}

return lift((paymentMethods, userTier) => ({
return lift((paymentMethods, userTier, userCountryCode) => ({
paymentMethods: invitations.openBanking
? paymentMethods
: {
...paymentMethods,
methods: filterPaymentMethods(paymentMethods.methods)
},
userCountryCode,
userTier
}))(paymentMethodsR, userTier)
}))(paymentMethodsR, userTier, userCountryCode)
}

export default getData

0 comments on commit 743052b

Please sign in to comment.