Skip to content

Commit

Permalink
Fix potentially false warning message. (#7339)
Browse files Browse the repository at this point in the history
* Fix potentially false warning message.

Fixes #7331.

* Create giant-bees-clean.md
  • Loading branch information
ehsannas authored Jun 6, 2023
1 parent 2ccc9dd commit fe7da7e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-bees-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/firestore": patch
---

Fix potentially false warning message.
9 changes: 5 additions & 4 deletions packages/firestore/src/lite-api/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,18 @@ export function connectFirestoreEmulator(
): void {
firestore = cast(firestore, Firestore);
const settings = firestore._getSettings();
const newHostSetting = `${host}:${port}`;

if (settings.host !== DEFAULT_HOST && settings.host !== host) {
if (settings.host !== DEFAULT_HOST && settings.host !== newHostSetting) {
logWarn(
'Host has been set in both settings() and useEmulator(), emulator host ' +
'will be used'
'Host has been set in both settings() and connectFirestoreEmulator(), emulator host ' +
'will be used.'
);
}

firestore._setSettings({
...settings,
host: `${host}:${port}`,
host: newHostSetting,
ssl: false
});

Expand Down

0 comments on commit fe7da7e

Please sign in to comment.