Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pass injector scope to promises
  • Loading branch information
jamesdaniels committed Dec 13, 2024
commit a184f69f7f82b432e48e80e7db56383e1b8cf4b6
6 changes: 3 additions & 3 deletions src/zones.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function getSchedulers() {
var alreadyWarned = false;
function warnOutsideInjectionContext(original: any, operation: string) {
if (isDevMode()) {
console.warn(`Firebase API called outside injection context: ${operation}(${original})`);
console.warn(`Firebase API called outside injection context: ${operation}(${original.name})`);
if (!alreadyWarned) {
alreadyWarned = true;
console.error("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");
Expand Down Expand Up @@ -196,8 +196,8 @@ export const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean): T => {
() =>
new Promise((resolve, reject) => {
pendingTasks.run(() => ret).then(
(it) => run(() => resolve(it)),
(reason) => run(() => reject(reason))
(it) => runInInjectionContext(injector, () => run(() => resolve(it))),
(reason) => runInInjectionContext(injector, () => run(() => reject(reason)))
);
})
);
Expand Down