From bd8d2d8512de9cabf4df22714f0577e321a3f8b4 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Mon, 31 Jan 2022 14:42:43 -0800 Subject: [PATCH] Add memory to textInput premium/satoshis --- api/tasks.py | 2 +- frontend/src/components/MakerPage.js | 51 ++++++++++++++-------------- frontend/src/components/OrderPage.js | 4 +-- frontend/src/components/TradeBox.js | 2 +- 4 files changed, 30 insertions(+), 29 deletions(-) diff --git a/api/tasks.py b/api/tasks.py index 3d6ef69c..e22be46f 100644 --- a/api/tasks.py +++ b/api/tasks.py @@ -46,7 +46,7 @@ def follow_send_payment(lnpayment): MACAROON = b64decode(config('LND_MACAROON_BASE64')) - fee_limit_sat = max(lnpayment.num_satoshis * 0.0002, 10) # 200 ppm or 10 sats max + fee_limit_sat = int(max(lnpayment.num_satoshis * float(config('PROPORTIONAL_ROUTING_FEE_LIMIT')), float(config('MIN_FLAT_ROUTING_FEE_LIMIT')))) # 200 ppm or 10 sats request = LNNode.routerrpc.SendPaymentRequest( payment_request=lnpayment.invoice, fee_limit_sat=fee_limit_sat, diff --git a/frontend/src/components/MakerPage.js b/frontend/src/components/MakerPage.js index 4cae9d9e..b4fa4320 100644 --- a/frontend/src/components/MakerPage.js +++ b/frontend/src/components/MakerPage.js @@ -89,15 +89,15 @@ export default class MakerPage extends Component { handleClickRelative=(e)=>{ this.setState({ is_explicit: false, - satoshis: null, - premium: 0, }); + this.handlePremiumChange(); } + handleClickExplicit=(e)=>{ this.setState({ - is_explicit: true, - premium: null, + is_explicit: true, }); + this.handleSatoshisChange(); } handleCreateOfferButtonPressed=()=>{ @@ -239,26 +239,27 @@ export default class MakerPage extends Component { {/* conditional shows either Premium % field or Satoshis field based on pricing method */} - { this.state.is_explicit - ? + +
+ +
+
- - : - - - } +
+
diff --git a/frontend/src/components/OrderPage.js b/frontend/src/components/OrderPage.js index db6c53c7..95621239 100644 --- a/frontend/src/components/OrderPage.js +++ b/frontend/src/components/OrderPage.js @@ -517,7 +517,7 @@ export default class OrderPage extends Component { {this.orderBox()} - + ) @@ -553,7 +553,7 @@ export default class OrderPage extends Component { {this.orderBox()}
- +
diff --git a/frontend/src/components/TradeBox.js b/frontend/src/components/TradeBox.js index ddc5ddfd..e4583f4c 100644 --- a/frontend/src/components/TradeBox.js +++ b/frontend/src/components/TradeBox.js @@ -677,7 +677,7 @@ handleRatingChange=(e)=>{ - + )