File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ export class PendingTasksInternal implements OnDestroy {
36
36
return taskId ;
37
37
}
38
38
39
+ has ( taskId : number ) : boolean {
40
+ return this . pendingTasks . has ( taskId ) ;
41
+ }
42
+
39
43
remove ( taskId : number ) : void {
40
44
this . pendingTasks . delete ( taskId ) ;
41
45
if ( this . pendingTasks . size === 0 && this . _hasPendingTasks ) {
@@ -90,6 +94,10 @@ export class PendingTasks {
90
94
add ( ) : ( ) => void {
91
95
const taskId = this . internalPendingTasks . add ( ) ;
92
96
return ( ) => {
97
+ if ( ! this . internalPendingTasks . has ( taskId ) ) {
98
+ // This pending task has already been cleared.
99
+ return ;
100
+ }
93
101
// Notifying the scheduler will hold application stability open until the next tick.
94
102
this . scheduler . notify ( NotificationSource . PendingTaskRemoved ) ;
95
103
this . internalPendingTasks . remove ( taskId ) ;
You can’t perform that action at this time.
0 commit comments