Skip to content

Commit

Permalink
get the app when fetching named firestore
Browse files Browse the repository at this point in the history
  • Loading branch information
colerogers committed May 3, 2024
1 parent 77c16ff commit 0239caf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common/providers/firestore.ts
Expand Up @@ -54,7 +54,7 @@ function _getValueProto(data: any, resource: string, valueFieldName: string) {
/** @internal */
export function createSnapshotFromProtobuf(data: Uint8Array, path: string, databaseId: string) {
if (!firestoreInstance) {
firestoreInstance = firestore.getFirestore(databaseId);
firestoreInstance = firestore.getFirestore(getApp(), databaseId);
}
try {
const dataBuffer = Buffer.from(data);
Expand All @@ -74,7 +74,7 @@ export function createBeforeSnapshotFromProtobuf(
databaseId: string
) {
if (!firestoreInstance) {
firestoreInstance = firestore.getFirestore(databaseId);
firestoreInstance = firestore.getFirestore(getApp(), databaseId);
}
try {
const dataBuffer = Buffer.from(data);
Expand All @@ -97,7 +97,7 @@ export function createSnapshotFromJson(
) {
if (!firestoreInstance) {
firestoreInstance = databaseId
? firestore.getFirestore(databaseId)
? firestore.getFirestore(getApp(), databaseId)
: firestore.getFirestore(getApp());
}
const valueProto = _getValueProto(data, source, "value");
Expand All @@ -122,7 +122,7 @@ export function createBeforeSnapshotFromJson(
) {
if (!firestoreInstance) {
firestoreInstance = databaseId
? firestore.getFirestore(databaseId)
? firestore.getFirestore(getApp(), databaseId)
: firestore.getFirestore(getApp());
}

Expand Down

0 comments on commit 0239caf

Please sign in to comment.