Skip to content

Commit

Permalink
fix(BuySell): preselect country
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip Welber committed May 30, 2018
1 parent 23856de commit d92be7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class BuySellContainer extends React.PureComponent {

componentDidMount () {
this.props.formActions.initialize('buySellTabStatus', { status: 'buy' })
this.props.formActions.change('selectPartner', 'country', this.props.data.data.countryCode)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { selectors } from 'data'
export const getData = (state) => {
const optionsR = selectors.core.walletOptions.getOptions(state)
const buySellR = selectors.core.kvStore.buySell.getMetadata(state)

const transform = lift((buySell, options) => ({ buySell, options }))
const countryCodeR = selectors.core.settings.getCountryCode(state)
const transform = lift((buySell, options, countryCode) => ({ buySell, options, countryCode }))

return {
data: transform(buySellR, optionsR),
data: transform(buySellR, optionsR, countryCodeR),
type: state.form.buySellTabStatus && state.form.buySellTabStatus.values.status,
country: formValueSelector('selectPartner')(state, 'country'),
stateSelection: formValueSelector('selectPartner')(state, 'state'),
Expand Down

0 comments on commit d92be7c

Please sign in to comment.