@@ -72,7 +72,9 @@ export class Firestore implements FirestoreService {
72
72
73
73
private _settings = new FirestoreSettingsImpl ( { } ) ;
74
74
private _settingsFrozen = false ;
75
- private _emulatorOptions ? : { mockUserToken ?: EmulatorMockTokenOptions | string ; } ;
75
+ private _emulatorOptions ?: {
76
+ mockUserToken ?: EmulatorMockTokenOptions | string ;
77
+ } ;
76
78
77
79
// A task that is assigned when the terminate() is invoked and resolved when
78
80
// all components have shut down. Otherwise, Firestore is not terminated,
@@ -122,22 +124,18 @@ export class Firestore implements FirestoreService {
122
124
}
123
125
this . _settings = new FirestoreSettingsImpl ( settings ) ;
124
126
this . _emulatorOptions = settings . emulatorOptions ;
125
-
127
+
126
128
if ( settings . credentials !== undefined ) {
127
129
this . _authCredentials = makeAuthCredentialsProvider ( settings . credentials ) ;
128
130
}
129
131
}
130
132
131
- _getSettings ( ) : FirestoreSettingsImpl {
132
- return this . _settings ;
133
- }
134
-
135
- _getPrivateSettings ( ) : PrivateSettings {
136
- const privateSettings : PrivateSettings = {
133
+ _getSettings ( ) : PrivateSettings {
134
+ const privateSettings : PrivateSettings = {
137
135
...this . _settings ,
138
136
emulatorOptions : this . _emulatorOptions
139
137
} ;
140
- if ( this . _settings . localCache !== undefined ) {
138
+ if ( this . _settings . localCache !== undefined ) {
141
139
privateSettings . localCache = this . _settings . localCache ;
142
140
}
143
141
return privateSettings ;
@@ -330,7 +328,7 @@ export function connectFirestoreEmulator(
330
328
} = { }
331
329
) : void {
332
330
firestore = cast ( firestore , Firestore ) ;
333
- const settings = firestore . _getPrivateSettings ( ) ;
331
+ const settings = firestore . _getSettings ( ) ;
334
332
const newHostSetting = `${ host } :${ port } ` ;
335
333
336
334
if ( settings . host !== DEFAULT_HOST && settings . host !== newHostSetting ) {
@@ -348,11 +346,11 @@ export function connectFirestoreEmulator(
348
346
349
347
// No-op if the new configuration matches the current configuration. This supports SSR
350
348
// enviornments which might call `connectFirestoreEmulator` multiple times as a standard practice.
351
- if ( deepEqual ( newSettings , settings ) ) {
352
- console . error ( " DEDB settings are the same!" ) ;
349
+ if ( deepEqual ( newSettings , settings ) ) {
350
+ console . error ( ' DEDB settings are the same!' ) ;
353
351
return ;
354
352
}
355
- console . error ( " DEDB settings differ!" )
353
+ console . error ( ' DEDB settings differ!' ) ;
356
354
357
355
firestore . _setSettings ( newSettings ) ;
358
356
0 commit comments