From c4538f1c0b57d3fb1646670e372268cfc3c91104 Mon Sep 17 00:00:00 2001 From: wjrjerome Date: Mon, 12 Aug 2024 21:07:32 +1000 Subject: [PATCH] fix: issue with fee UI infinite react rendering loop --- .github/workflows/ci.yml | 4 ++-- .github/workflows/publish.yaml | 8 +++---- .../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, 36 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7083d434..b3976930 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,11 +3,11 @@ name: ci on: pull_request: branches: - - '**' + - "**" jobs: lint_test: uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@v0.3.0 with: run-build: true - run-unit-tests: true \ No newline at end of file + run-unit-tests: true diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 96ed64c2..2c9f4030 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,10 +3,10 @@ name: docker_publish on: push: branches: - - 'main' - - 'dev' + - "main" + - "dev" tags: - - '*' + - "*" jobs: lint_test: @@ -14,7 +14,7 @@ jobs: with: run-build: true run-unit-tests: true - + docker_build: needs: [lint_test] runs-on: ubuntu-22.04 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} - -

- ) : ( - - )}