File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/firestore/src/api Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ import {
117117 validateIsNotUsedTogether ,
118118 validateSetOptions
119119} from '../util/input_validation' ;
120- import { setLogLevel as setClientLogLevel } from '../util/log' ;
120+ import { logWarn , setLogLevel as setClientLogLevel } from '../util/log' ;
121121
122122import { Blob } from './blob' ;
123123import {
@@ -216,14 +216,26 @@ export class Firestore
216216 }
217217
218218 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+
219230 if ( settingsLiteral . merge ) {
220231 settingsLiteral = {
221- ...this . _delegate . _getSettings ( ) ,
232+ ...currentSettings ,
222233 ...settingsLiteral
223234 } ;
224235 // Remove the property from the settings once the merge is completed
225236 delete settingsLiteral . merge ;
226237 }
238+
227239 this . _delegate . _setSettings ( settingsLiteral ) ;
228240 }
229241
You can’t perform that action at this time.
0 commit comments