Skip to content

Commit 6072bd2

Browse files
committed
Fix potentially false warning message.
Fixes #7331.
1 parent e12e7f5 commit 6072bd2

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

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)