From f7b9ca67d47919b85aefeb1a2498643e32cc5f2f Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Thu, 19 May 2022 02:39:00 -0700 Subject: [PATCH] Fix reverse buy/sell on maker to book page transitions --- frontend/src/components/MakerPage.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/MakerPage.js b/frontend/src/components/MakerPage.js index 6f26c0d4..d1c4c64a 100644 --- a/frontend/src/components/MakerPage.js +++ b/frontend/src/components/MakerPage.js @@ -67,7 +67,7 @@ class MakerPage extends Component { // if currency or type have changed in HomePage state, change in MakerPage state too. this.setState({ 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 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, sellChecked: e.target.value == 1 ? true: false, })