From 3b571bbc30b0b1385b9e62e04073092ce8c683a2 Mon Sep 17 00:00:00 2001 From: Crypto Minion <154598612+jrwbabylonlab@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:49:43 +1000 Subject: [PATCH] fix: issue with fee UI react rendering loop (#66) * fix: issue with fee UI infinite react rendering loop --- package-lock.json | 4 ++-- package.json | 2 +- .../components/Staking/Form/StakingFee.tsx | 24 +++++++++---------- src/app/components/Staking/Staking.tsx | 1 + src/utils/isStakingSignReady.ts | 8 +++++++ tests/utils/isStakingSignReady.test.ts | 12 ++++++++-- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5027773..e3228569 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-staking", - "version": "0.2.31", + "version": "0.2.32", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-staking", - "version": "0.2.31", + "version": "0.2.32", "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@keystonehq/animated-qr": "^0.8.6", diff --git a/package.json b/package.json index b9087f41..1657ae19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-staking", - "version": "0.2.31", + "version": "0.2.32", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/components/Staking/Form/StakingFee.tsx b/src/app/components/Staking/Form/StakingFee.tsx index d2da2131..b43d0720 100644 --- a/src/app/components/Staking/Form/StakingFee.tsx +++ b/src/app/components/Staking/Form/StakingFee.tsx @@ -51,22 +51,20 @@ export const StakingFee: React.FC = ({
{mempoolFeeRates ? ( -

- Recommended fee rate: {defaultFeeRate} sats/vB -

+
+

+ Recommended fee rate: {defaultFeeRate} sats/vB +

+

+ Transaction fee amount:{" "} + + {satoshiToBtc(stakingFeeSat)} {coinName} + +

+
) : ( )} - {stakingFeeSat ? ( -

- Transaction fee amount:{" "} - - {satoshiToBtc(stakingFeeSat)} {coinName} - -

- ) : ( - - )}