Skip to content

Commit 4aa48fe

Browse files
committed
Fix incorrect use of typed QueryDocumentSnapshot and ExpQueryDocumentSnapshot in fromFirestore
1 parent 926a617 commit 4aa48fe

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

packages/firestore/src/api/database.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -575,18 +575,16 @@ class FirestoreDataConverter<U>
575575
snapshot: ExpQueryDocumentSnapshot,
576576
options?: PublicSnapshotOptions
577577
): U {
578+
const expSnapshot = new ExpQueryDocumentSnapshot(
579+
this._firestore._delegate,
580+
this._userDataWriter,
581+
snapshot._key,
582+
snapshot._document,
583+
snapshot.metadata,
584+
/* converter= */ null
585+
);
578586
return this._delegate.fromFirestore(
579-
new QueryDocumentSnapshot<U>(
580-
this._firestore,
581-
new ExpQueryDocumentSnapshot<U>(
582-
this._firestore._delegate,
583-
this._userDataWriter,
584-
snapshot._key,
585-
snapshot._document,
586-
snapshot.metadata,
587-
/* converter= */ null
588-
)
589-
),
587+
new QueryDocumentSnapshot(this._firestore, expSnapshot),
590588
options ?? {}
591589
);
592590
}

0 commit comments

Comments
 (0)