File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -255,3 +255,8 @@ a:visited {
255255 background-color : transparent ;
256256 text-decoration : none ;
257257}
258+
259+ .firebase-emulator-warning {
260+ font-size : 10px ;
261+ height : 10px ;
262+ }
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ interface FirebaseError extends Error {
1818const app = firebase . initializeApp ( config . firebase ) ;
1919let db = firebase . firestore ( ) ;
2020
21+ // WARNING: This function is enabling local emulator. If removed, move the emulator config out of this function
2122enableUnlimitedCachePersistence ( ) ;
2223// Function to handle Firestore persistence errors
2324function handlePersistenceError ( err : any ) {
@@ -79,21 +80,19 @@ function enableUnlimitedCachePersistence() {
7980 cacheSizeBytes : CACHE_SIZE_LIMIT ,
8081 } ;
8182 db . settings ( settings ) ;
82-
83+ // Enable Firestore emulator in the local environment
84+ if ( REACT_APP_ENV === Environment . Local ) {
85+ firebase . auth ( ) . useEmulator ( local . firebase . authDomain ) ;
86+ firebase
87+ . firestore ( )
88+ . useEmulator (
89+ "localhost" ,
90+ Number ( local . firebase . databaseURL . split ( / : / g) [ 2 ] ) ,
91+ ) ;
92+ }
8393 db . enablePersistence ( { synchronizeTabs : true } ) . catch ( handlePersistenceError ) ;
8494}
8595
86- // Enable persistence in the local environment (with Firestore and Auth emulators)
87- if ( REACT_APP_ENV === Environment . Local ) {
88- firebase . auth ( ) . useEmulator ( local . firebase . authDomain ) ;
89- firebase
90- . firestore ( )
91- . useEmulator (
92- "localhost" ,
93- Number ( local . firebase . databaseURL . split ( / : / g) [ 2 ] ) ,
94- ) ;
95- }
96-
9796let perf ;
9897if ( typeof window !== "undefined" && typeof window . fetch !== "undefined" ) {
9998 perf = getPerformance ( app ) ;
You can’t perform that action at this time.
0 commit comments