Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { FirebaseApp, FirebaseApps } from './app';

export function defaultFirebaseAppFactory(provided: FirebaseApp[]|undefined) {
// Use the provided app, if there is only one, otherwise fetch the default app
if (provided && provided.length === 1) { return provided[0]; }
if (provided?.length === 1) { return provided[0]; }
return new FirebaseApp(getApp());
}

Expand Down
2 changes: 1 addition & 1 deletion src/compat/firebase.app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function ɵfirebaseAppFactory(options: FirebaseOptions, zone: NgZone, nam
const config = typeof nameOrConfig === 'object' && nameOrConfig || {};
config.name = config.name || name;
// Added any due to some inconsistency between @firebase/app and firebase types
const existingApp = firebase.apps.find(app => app && app.name === config.name);
const existingApp = firebase.apps.find(app => app?.name === config.name);
// We support FirebaseConfig, initializeApp's public type only accepts string; need to cast as any
// Could be solved with https://github.com/firebase/firebase-js-sdk/pull/1206
const app = (existingApp || zone.runOutsideAngular(() => firebase.initializeApp(options, config as any)));
Expand Down
Loading