File tree 1 file changed +4
-6
lines changed
packages/firestore/src/api 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -649,7 +649,7 @@ export class Firestore
649
649
650
650
batch ( ) : PublicWriteBatch {
651
651
this . _ensureClientConfigured ( ) ;
652
- return new WriteBatch ( this , this . _firestoreClient ! ) ;
652
+ return new WriteBatch ( this ) ;
653
653
}
654
654
655
655
// Visible for testing.
@@ -815,10 +815,7 @@ export class WriteBatch implements PublicWriteBatch {
815
815
private _mutations = [ ] as Mutation [ ] ;
816
816
private _committed = false ;
817
817
818
- constructor (
819
- private _firestore : Firestore ,
820
- private _firestoreClient : FirestoreClient
821
- ) { }
818
+ constructor ( private _firestore : Firestore ) { }
822
819
823
820
set < T > (
824
821
documentRef : DocumentReference < T > ,
@@ -932,7 +929,8 @@ export class WriteBatch implements PublicWriteBatch {
932
929
this . verifyNotCommitted ( ) ;
933
930
this . _committed = true ;
934
931
if ( this . _mutations . length > 0 ) {
935
- return firestoreClientWrite ( this . _firestoreClient , this . _mutations ) ;
932
+ const firestoreClient = this . _firestore . _ensureClientConfigured ( ) ;
933
+ return firestoreClientWrite ( firestoreClient , this . _mutations ) ;
936
934
}
937
935
938
936
return Promise . resolve ( ) ;
You can’t perform that action at this time.
0 commit comments