File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/core/src/hooks/useractions Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments