From 26aba26da538fa978f1b0f205f5e09647709e362 Mon Sep 17 00:00:00 2001 From: Ian Philips Date: Wed, 31 Aug 2022 15:38:55 -0600 Subject: [PATCH] force long polling (#824) --- web/lib/firebase/init.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/web/lib/firebase/init.ts b/web/lib/firebase/init.ts index bf712a8f..b9c96a9b 100644 --- a/web/lib/firebase/init.ts +++ b/web/lib/firebase/init.ts @@ -1,13 +1,18 @@ -import { getFirestore } from '@firebase/firestore' import { initializeApp, getApps, getApp } from 'firebase/app' import { getStorage } from 'firebase/storage' import { FIREBASE_CONFIG } from 'common/envs/constants' -import { connectFirestoreEmulator } from 'firebase/firestore' +import { + connectFirestoreEmulator, + initializeFirestore, +} from 'firebase/firestore' import { connectFunctionsEmulator, getFunctions } from 'firebase/functions' // Initialize Firebase export const app = getApps().length ? getApp() : initializeApp(FIREBASE_CONFIG) -export const db = getFirestore() + +export const db = initializeFirestore(app, { + experimentalForceLongPolling: true, +}) export const functions = getFunctions() export const storage = getStorage()