Skip to content

Commit 9f67976

Browse files
committed
Review updates.
1 parent 832f81e commit 9f67976

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/app/src/api.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export function initializeServerApp(
235235
/**
236236
* Creates and initializes a {@link @firebase/app#FirebaseServerApp} instance.
237237
*
238-
* @param config - Optional `FirebaseServerApp` configuration.
238+
* @param config - Optional `FirebaseServerApp` settings.
239239
*
240240
* @returns The initialized `FirebaseServerApp`.
241241
*
@@ -253,21 +253,23 @@ export function initializeServerApp(
253253
throw ERROR_FACTORY.create(AppError.INVALID_SERVER_APP_ENVIRONMENT);
254254
}
255255

256-
let app: FirebaseApp;
257256
let firebaseOptions: FirebaseOptions | undefined;
258257
let serverAppSettings: FirebaseServerAppSettings = _serverAppConfig || {};
259258

260259
if (_options) {
261260
if (_isFirebaseApp(_options)) {
262-
app = _options;
263-
firebaseOptions = app.options;
261+
firebaseOptions = _options.options;
264262
} else if (_isFirebaseServerAppSettings(_options)) {
265263
serverAppSettings = _options;
266264
} else {
267265
firebaseOptions = _options;
268266
}
269267
}
270268

269+
if (serverAppSettings.automaticDataCollectionEnabled === undefined) {
270+
serverAppSettings.automaticDataCollectionEnabled = true;
271+
}
272+
271273
firebaseOptions ||= getDefaultAppConfig();
272274
if (!firebaseOptions) {
273275
throw ERROR_FACTORY.create(AppError.NO_OPTIONS);

0 commit comments

Comments
 (0)