From 59bca90b4c4c0b0f0cb6a8d5dd476425a6703e8d Mon Sep 17 00:00:00 2001 From: Mohan Date: Fri, 6 Sep 2024 19:07:18 +0530 Subject: [PATCH] feat: Add balance polling pause functionality to StakingContractSection (#330) --- .../ManageStakingPage/StakingContractSection/index.tsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/components/ManageStakingPage/StakingContractSection/index.tsx b/frontend/components/ManageStakingPage/StakingContractSection/index.tsx index 5db3a065c..ab9e9382e 100644 --- a/frontend/components/ManageStakingPage/StakingContractSection/index.tsx +++ b/frontend/components/ManageStakingPage/StakingContractSection/index.tsx @@ -43,7 +43,12 @@ export const StakingContractSection = ({ const { activeStakingProgram, defaultStakingProgram, updateStakingProgram } = useStakingProgram(); const { token } = useToken(); - const { safeBalance, totalOlasStakedBalance, isBalanceLoaded } = useBalance(); + const { + safeBalance, + totalOlasStakedBalance, + isBalanceLoaded, + setIsPaused: setIsBalancePollingPaused, + } = useBalance(); const { isServiceStakedForMinimumDuration, stakingContractInfoRecord } = useStakingContractInfo(); const [isFundingSectionOpen, setIsFundingSectionOpen] = useState(false); @@ -264,6 +269,8 @@ export const StakingContractSection = ({ disabled={!canMigrate} onClick={async () => { setIsServicePollingPaused(true); + setIsBalancePollingPaused(true); + try { setServiceStatus(DeploymentStatus.DEPLOYING); goto(Pages.Main); @@ -281,6 +288,7 @@ export const StakingContractSection = ({ console.error(error); } finally { setIsServicePollingPaused(false); + setIsBalancePollingPaused(false); updateServiceStatus(); } }}