Stop poll for checking balance if funds are sufficient

This commit is contained in:
IshaVenikar 2025-02-11 14:56:07 +05:30
parent e7cd642242
commit 875a404702

View File

@ -436,23 +436,20 @@ const Configure = () => {
}, []);
useEffect(() => {
if (isAccountsDataReceived && !isBalanceSufficient) {
if (isAccountsDataReceived) {
checkBalance();
const interval = setInterval(() => {
checkBalance();
}, CHECK_BALANCE_INTERVAL);
if (!isBalanceSufficient) {
const interval = setInterval(() => {
checkBalance();
}, CHECK_BALANCE_INTERVAL);
return () => {
clearInterval(interval);
};
return () => {
clearInterval(interval);
};
}
}
}, [
amountToBePaid,
selectedAccount,
selectedDeployer,
isAccountsDataReceived,
]);
}, [isAccountsDataReceived, isBalanceSufficient, checkBalance]);
return (
<div className="space-y-7 px-4 py-6">