Skip to content

Commit e4690e3

Browse files
committed
wip
1 parent 20619c9 commit e4690e3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/core/src/hooks/useractions/useCheckAccStatus.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,26 @@ export const useCheckActiveStatus = <C extends FeeInfo>({
115115
setKnowDisable(false)
116116
}, [chargeFeeTokenList])
117117

118+
const checkFeeIsEnoughInterval = React.useRef<NodeJS.Timeout | -1>(-1)
119+
118120
React.useEffect(() => {
119121
if (walletLayer2Callback && walletLayer2Status === SagaStatus.UNSET) {
120122
walletLayer2Callback()
121123
checkFeeIsEnough()
122124
}
125+
checkFeeIsEnoughInterval.current = setInterval(() => {
126+
updateWalletLayer2()
127+
walletLayer2Callback()
128+
checkFeeIsEnough()
129+
}, 10 * 1000)
130+
return () => {
131+
if (checkFeeIsEnoughInterval.current !== -1) {
132+
clearInterval(checkFeeIsEnoughInterval.current)
133+
}
134+
}
123135
}, [walletLayer2Status])
124136

137+
125138
const init = React.useCallback(async () => {
126139
setKnowDisable(true)
127140
try {

0 commit comments

Comments
 (0)