Skip to content

Commit fc1b6b6

Browse files
authored
Update firestore.ts
Use FIRESTORE_HOST in clearFirestoreData (firebase#193)
1 parent 8775696 commit fc1b6b6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/providers/firestore.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ const FIRESTORE_ADDRESS = FIRESTORE_ADDRESS_ENVS.reduce(
255255
'localhost:8080'
256256
);
257257
const FIRESTORE_PORT = FIRESTORE_ADDRESS.split(':')[1];
258+
const FIRESTORE_HOST = FIRESTORE_ADDRESS.split(':')[0];
258259

259260
/** Clears all data in firestore. Works only in offline mode.
260261
*/
@@ -272,7 +273,7 @@ export function clearFirestoreData(options: { projectId: string } | string) {
272273

273274
const config = {
274275
method: 'DELETE',
275-
hostname: 'localhost',
276+
hostname: FIRESTORE_HOST,
276277
port: FIRESTORE_PORT,
277278
path: `/emulator/v1/projects/${projectId}/databases/(default)/documents`,
278279
};

0 commit comments

Comments
 (0)