Skip to content

Commit 14ec68a

Browse files
maneeshtmansisampat
authored andcommitted
Updated to only show banner when calling connect*Emulator (#9055)
1 parent a859d55 commit 14ec68a

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

.changeset/large-windows-mate.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@firebase/auth": patch
3+
"@firebase/data-connect": patch
4+
"@firebase/database": patch
5+
"@firebase/firestore": patch
6+
"@firebase/functions": patch
7+
"@firebase/storage": patch
8+
---
9+
10+
Updated to only show banner when calling connect*Emulator

packages/auth/src/core/auth/emulator.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ import { Auth } from '../../model/public_types';
1818
import { AuthErrorCode } from '../errors';
1919
import { _assert } from '../util/assert';
2020
import { _castAuth } from './auth_impl';
21-
import { deepEqual, isCloudWorkstation, pingServer } from '@firebase/util';
21+
import {
22+
deepEqual,
23+
isCloudWorkstation,
24+
pingServer,
25+
updateEmulatorBanner
26+
} from '@firebase/util';
2227

2328
/**
2429
* Changes the {@link Auth} instance to communicate with the Firebase Auth Emulator, instead of production

packages/database/src/api/Database.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ import {
3131
EmulatorMockTokenOptions,
3232
getDefaultEmulatorHostnameAndPort,
3333
isCloudWorkstation,
34-
pingServer
34+
pingServer,
35+
updateEmulatorBanner
3536
} from '@firebase/util';
3637

3738
import { AppCheckTokenProvider } from '../core/AppCheckTokenProvider';
@@ -393,6 +394,7 @@ export function connectDatabaseEmulator(
393394
// Workaround to get cookies in Firebase Studio
394395
if (isCloudWorkstation(host)) {
395396
void pingServer(host);
397+
updateEmulatorBanner('Database', true);
396398
}
397399

398400
// Modify the repo to apply emulator settings

packages/functions/src/service.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ import { Provider } from '@firebase/component';
3030
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
3131
import { MessagingInternalComponentName } from '@firebase/messaging-interop-types';
3232
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
33-
import { isCloudWorkstation, pingServer } from '@firebase/util';
33+
import {
34+
isCloudWorkstation,
35+
pingServer,
36+
updateEmulatorBanner
37+
} from '@firebase/util';
3438

3539
export const DEFAULT_REGION = 'us-central1';
3640

@@ -182,6 +186,7 @@ export function connectFunctionsEmulator(
182186
// Workaround to get cookies in Firebase Studio
183187
if (useSsl) {
184188
void pingServer(functionsInstance.emulatorOrigin);
189+
updateEmulatorBanner('Functions', true);
185190
}
186191
}
187192

packages/storage/src/service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ import {
4646
createMockUserToken,
4747
EmulatorMockTokenOptions,
4848
isCloudWorkstation,
49-
pingServer
49+
pingServer,
50+
updateEmulatorBanner
5051
} from '@firebase/util';
5152
import { Connection, ConnectionType } from './implementation/connection';
5253

0 commit comments

Comments
 (0)