Skip to content

Commit

Permalink
feat: Add balance polling pause functionality to StakingContractSecti…
Browse files Browse the repository at this point in the history
…on (#330)
  • Loading branch information
mohandast52 authored Sep 6, 2024
1 parent 1b235d1 commit 59bca90
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -264,6 +269,8 @@ export const StakingContractSection = ({
disabled={!canMigrate}
onClick={async () => {
setIsServicePollingPaused(true);
setIsBalancePollingPaused(true);

try {
setServiceStatus(DeploymentStatus.DEPLOYING);
goto(Pages.Main);
Expand All @@ -281,6 +288,7 @@ export const StakingContractSection = ({
console.error(error);
} finally {
setIsServicePollingPaused(false);
setIsBalancePollingPaused(false);
updateServiceStatus();
}
}}
Expand Down

0 comments on commit 59bca90

Please sign in to comment.