File tree 1 file changed +14
-2
lines changed
packages/firestore/src/api 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ import {
117
117
validateIsNotUsedTogether ,
118
118
validateSetOptions
119
119
} from '../util/input_validation' ;
120
- import { setLogLevel as setClientLogLevel } from '../util/log' ;
120
+ import { logWarn , setLogLevel as setClientLogLevel } from '../util/log' ;
121
121
122
122
import { Blob } from './blob' ;
123
123
import {
@@ -216,14 +216,26 @@ export class Firestore
216
216
}
217
217
218
218
settings ( settingsLiteral : PublicSettings ) : void {
219
+ const currentSettings = this . _delegate . _getSettings ( ) ;
220
+ if (
221
+ ! settingsLiteral . merge &&
222
+ currentSettings . host !== settingsLiteral . host
223
+ ) {
224
+ logWarn (
225
+ 'You are overriding the original host. If you did not intend ' +
226
+ 'to override your settings, use {merge: true}.'
227
+ ) ;
228
+ }
229
+
219
230
if ( settingsLiteral . merge ) {
220
231
settingsLiteral = {
221
- ...this . _delegate . _getSettings ( ) ,
232
+ ...currentSettings ,
222
233
...settingsLiteral
223
234
} ;
224
235
// Remove the property from the settings once the merge is completed
225
236
delete settingsLiteral . merge ;
226
237
}
238
+
227
239
this . _delegate . _setSettings ( settingsLiteral ) ;
228
240
}
229
241
You can’t perform that action at this time.
0 commit comments