| 87 | |
| 88 | var alreadyWarned = false; |
| 89 | function warnOutsideInjectionContext(original: any, logLevel: LogLevel) { |
| 90 | if (!alreadyWarned && (currentLogLevel > LogLevel.SILENT || isDevMode())) { |
| 91 | alreadyWarned = true; |
| 92 | console.warn("Calling Firebase APIs outside of an Injection context may destabilize your application leading to subtle change-detection and hydration bugs. Find more at https://github.com/angular/angularfire/blob/main/docs/zones.md"); |
| 93 | } |
| 94 | if (currentLogLevel >= logLevel) { |
| 95 | console.warn(`Firebase API called outside injection context: ${original.name}`); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | function runOutsideAngular<T>(fn: (...args: any[]) => T): T { |
| 100 | const ngZone = inject(NgZone, { optional: true }); |