Skip to content

Commit

Permalink
fix(withdraw): put correct code after merge (#6304)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Feb 26, 2024
1 parent 9cab708 commit 89d3663
Showing 1 changed file with 5 additions and 2 deletions.
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 89d3663

Please sign in to comment.