Skip to content

Commit

Permalink
Enable offline persistency
Browse files Browse the repository at this point in the history
  • Loading branch information
sbutz committed Dec 21, 2023
1 parent 401a180 commit dd12f31
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion client/src/store/Firebase.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { initializeApp } from 'firebase/app';
import { connectAuthEmulator, getAuth } from 'firebase/auth';
import { initializeFirestore, connectFirestoreEmulator } from 'firebase/firestore';
import { initializeFirestore, connectFirestoreEmulator, enableMultiTabIndexedDbPersistence } from 'firebase/firestore';
import { getFunctions, connectFunctionsEmulator } from 'firebase/functions';
import isDevelopment from '../util/environment';

Expand All @@ -20,6 +20,7 @@ if (isDevelopment()) { connectAuthEmulator(auth, 'http://localhost:9099', { disa

const db = initializeFirestore(app, { ignoreUndefinedProperties: true });
if (isDevelopment()) { connectFirestoreEmulator(db, 'localhost', 8080); }
enableMultiTabIndexedDbPersistence(db);

const functions = getFunctions(app);
if (isDevelopment()) { connectFunctionsEmulator(functions, 'localhost', 5001); }
Expand Down

0 comments on commit dd12f31

Please sign in to comment.