Skip to content

Commit fe7da7e

Browse files
authored
Fix potentially false warning message. (#7339)
* Fix potentially false warning message. Fixes #7331. * Create giant-bees-clean.md
1 parent 2ccc9dd commit fe7da7e

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.changeset/giant-bees-clean.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/firestore": patch
3+
---
4+
5+
Fix potentially false warning message.

packages/firestore/src/lite-api/database.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -301,17 +301,18 @@ export function connectFirestoreEmulator(
301301
): void {
302302
firestore = cast(firestore, Firestore);
303303
const settings = firestore._getSettings();
304+
const newHostSetting = `${host}:${port}`;
304305

305-
if (settings.host !== DEFAULT_HOST && settings.host !== host) {
306+
if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) {
306307
logWarn(
307-
'Host has been set in both settings() and useEmulator(), emulator host ' +
308-
'will be used'
308+
'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' +
309+
'will be used.'
309310
);
310311
}
311312

312313
firestore._setSettings({
313314
...settings,
314-
host: `${host}:${port}`,
315+
host: newHostSetting,
315316
ssl: false
316317
});
317318

0 commit comments

Comments
 (0)