From ae0b803a65d419518ac283c211d4e0bc283ff032 Mon Sep 17 00:00:00 2001 From: wjrjerome Date: Wed, 10 Jul 2024 14:39:06 +1000 Subject: [PATCH] fix: approaching tvl cap should display overflow warning --- package-lock.json | 4 ++-- package.json | 2 +- src/app/components/Staking/Staking.tsx | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e22f05d7..270691a8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "simple-staking", - "version": "0.2.7", + "version": "0.2.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "simple-staking", - "version": "0.2.7", + "version": "0.2.8", "dependencies": { "@bitcoinerlab/secp256k1": "^1.1.1", "@keystonehq/animated-qr": "^0.8.6", diff --git a/package.json b/package.json index b966d5c9..3101723c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "simple-staking", - "version": "0.2.7", + "version": "0.2.8", "private": true, "scripts": { "dev": "next dev", diff --git a/src/app/components/Staking/Staking.tsx b/src/app/components/Staking/Staking.tsx index 9e98aca6..45695247 100644 --- a/src/app/components/Staking/Staking.tsx +++ b/src/app/components/Staking/Staking.tsx @@ -4,7 +4,10 @@ import { Dispatch, SetStateAction, useEffect, useMemo, useState } from "react"; import { Tooltip } from "react-tooltip"; import { useLocalStorage } from "usehooks-ts"; -import { OVERFLOW_HEIGHT_WARNING_THRESHOLD } from "@/app/common/constants"; +import { + OVERFLOW_HEIGHT_WARNING_THRESHOLD, + OVERFLOW_TVL_WARNING_THRESHOLD, +} from "@/app/common/constants"; import { LoadingView } from "@/app/components/Loading/Loading"; import { useError } from "@/app/context/Error/ErrorContext"; import { useGlobalParams } from "@/app/context/api/GlobalParamsProvider"; @@ -190,7 +193,7 @@ export const Staking: React.FC = ({ isHeightCap: false, overTheCapRange: stakingCapSat <= activeTVLSat, approchingCapRange: - stakingCapSat * OVERFLOW_HEIGHT_WARNING_THRESHOLD < unconfirmedTVLSat, + stakingCapSat * OVERFLOW_TVL_WARNING_THRESHOLD < unconfirmedTVLSat, }); } }, [paramWithCtx, btcHeight, stakingStats]);