Fix reverse buy/sell on maker to book page transitions

This commit is contained in:
Reckless_Satoshi 2022-05-19 02:39:00 -07:00
parent 5f17a1608b
commit f7b9ca67d4
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -67,7 +67,7 @@ class MakerPage extends Component {
// if currency or type have changed in HomePage state, change in MakerPage state too. // if currency or type have changed in HomePage state, change in MakerPage state too.
this.setState({ this.setState({
currency: !this.props.currency === 0 ? this.props.currency : this.state.currency, currency: !this.props.currency === 0 ? this.props.currency : this.state.currency,
type: !this.props.type === 2 ? this.props.type : this.state.type, type: !this.props.type == 2 ? (this.props.type == 1 ? 0 : 1) : this.state.type,
}) })
} }
@ -99,7 +99,8 @@ class MakerPage extends Component {
}) })
// Share state with HomePage and OrderPage // Share state with HomePage and OrderPage
this.props.setAppState({ this.props.setAppState({
type: e.target.value, // maker and book page type values 0:1 are reversed
type: (e.target.value == 1 ? 0 : 1),
buyChecked: e.target.value == 0 ? true: false, buyChecked: e.target.value == 0 ? true: false,
sellChecked: e.target.value == 1 ? true: false, sellChecked: e.target.value == 1 ? true: false,
}) })