File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,13 @@ export class ɵZoneScheduler implements SchedulerLike {
33
33
// Wrap the specified work function to make sure that if nested scheduling takes place the
34
34
// work is executed in the correct zone
35
35
const workInZone = function ( this : SchedulerAction < any > , state : any ) {
36
- targetZone . runGuarded ( ( ) => {
36
+ if ( targetZone ) {
37
+ targetZone . runGuarded ( ( ) => {
38
+ work . apply ( this , [ state ] ) ;
39
+ } ) ;
40
+ } else {
37
41
work . apply ( this , [ state ] ) ;
38
- } ) ;
42
+ }
39
43
} ;
40
44
41
45
// Scheduling itself needs to be run in zone to ensure setInterval calls for async scheduling are done
@@ -73,11 +77,14 @@ export class ɵAngularFireSchedulers {
73
77
constructor ( public ngZone : NgZone , public pendingTasks : ExperimentalPendingTasks ) {
74
78
this . outsideAngular = ngZone . runOutsideAngular (
75
79
// @ts -ignore
76
- ( ) => new ɵZoneScheduler ( Zone . current )
80
+ ( ) => new ɵZoneScheduler ( typeof Zone === 'undefined' ? undefined : Zone . current )
77
81
) ;
78
82
this . insideAngular = ngZone . run (
79
83
// @ts -ignore
80
- ( ) => new ɵZoneScheduler ( Zone . current , asyncScheduler )
84
+ ( ) => new ɵZoneScheduler (
85
+ typeof Zone === 'undefined' ? undefined : Zone . current ,
86
+ asyncScheduler
87
+ )
81
88
) ;
82
89
globalThis . ɵAngularFireScheduler ||= this ;
83
90
}
You can’t perform that action at this time.
0 commit comments