From ba072652a7b456542a94d65df814ad69581cd879 Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Fri, 10 Mar 2023 15:43:52 -0800 Subject: [PATCH] Fix expand amount details on non swap orders --- frontend/src/components/OrderDetails/index.tsx | 12 +++++++----- frontend/src/utils/computeSats.ts | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/src/components/OrderDetails/index.tsx b/frontend/src/components/OrderDetails/index.tsx index 00db7d74..4f21a20d 100644 --- a/frontend/src/components/OrderDetails/index.tsx +++ b/frontend/src/components/OrderDetails/index.tsx @@ -286,11 +286,13 @@ const OrderDetails = ({ primary={amountString} secondary={order.amount ? 'Amount' : 'Amount Range'} /> - - setShowSwapDetails(!showSwapDetails)}> - {showSwapDetails ? : } - - + {order.currency === 1000 ? ( + + setShowSwapDetails(!showSwapDetails)}> + {showSwapDetails ? : } + + + ) : null} {order.currency === 1000 ? ( diff --git a/frontend/src/utils/computeSats.ts b/frontend/src/utils/computeSats.ts index 5a7d1d68..26578f8d 100644 --- a/frontend/src/utils/computeSats.ts +++ b/frontend/src/utils/computeSats.ts @@ -14,7 +14,7 @@ const computeSats = ({ routingBudget = 0, rate = 1, }: computeSatsProps): string | undefined => { - let rateWithPremium = rate + premium / 100; + const rateWithPremium = rate + premium / 100; let sats = (amount / rateWithPremium) * 100000000; sats = sats * (1 + fee) * (1 - routingBudget); return pn(Math.round(sats));