File tree 1 file changed +6
-1
lines changed
packages/storage/src/implementation
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ export function start(
42
42
// TODO: find a way to exclude Node type definition for storage because storage only works in browser
43
43
// eslint-disable-next-line @typescript-eslint/no-explicit-any
44
44
let timeoutId : any = null ;
45
+ let hitTimeoutId : any = null ;
45
46
let hitTimeout = false ;
46
47
let cancelState = 0 ;
47
48
@@ -69,6 +70,9 @@ export function start(
69
70
return ;
70
71
}
71
72
if ( success ) {
73
+ if ( hitTimeoutId !== null ) {
74
+ clearTimeout ( hitTimeoutId ) ;
75
+ }
72
76
triggerCallback . call ( null , success , ...args ) ;
73
77
return ;
74
78
}
@@ -113,7 +117,8 @@ export function start(
113
117
}
114
118
}
115
119
callWithDelay ( 0 ) ;
116
- setTimeout ( ( ) => {
120
+ hitTimeoutId = setTimeout ( function ( ) {
121
+ hitTimeoutId = null ;
117
122
hitTimeout = true ;
118
123
stop ( true ) ;
119
124
} , timeout ) ;
You can’t perform that action at this time.
0 commit comments