Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
get the app when fetching named firestore
  • Loading branch information
colerogers committed May 3, 2024
commit 0239caf1884f6e5bd4d123909357e4c656ac1018
8 changes: 4 additions & 4 deletions src/common/providers/firestore.ts
Original file line number Diff line number Diff line change
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