Skip to content

Commit 2a03cae

Browse files
Fix compile
1 parent 614208a commit 2a03cae

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

packages/firestore/lite/src/api/transaction.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,14 @@ export function runTransaction<T>(
178178
updateFunction: (transaction: firestore.Transaction) => Promise<T>
179179
): Promise<T> {
180180
const firestoreClient = cast(firestore, Firestore);
181-
return getDatastore(firestoreClient).then(async datastore => {
182-
const deferred = new Deferred<T>();
183-
new TransactionRunner<T>(
184-
new AsyncQueue(),
185-
datastore,
186-
internalTransaction =>
187-
updateFunction(new Transaction(firestoreClient, internalTransaction)),
188-
deferred
189-
).run();
190-
return deferred.promise;
191-
});
181+
const datastore = getDatastore(firestoreClient);
182+
const deferred = new Deferred<T>();
183+
new TransactionRunner<T>(
184+
new AsyncQueue(),
185+
datastore,
186+
internalTransaction =>
187+
updateFunction(new Transaction(firestoreClient, internalTransaction)),
188+
deferred
189+
).run();
190+
return deferred.promise;
192191
}

packages/firestore/lite/src/api/write_batch.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ export function writeBatch(
181181
firestore: firestore.FirebaseFirestore
182182
): firestore.WriteBatch {
183183
const firestoreImpl = cast(firestore, Firestore);
184+
const datastore = getDatastore(firestoreImpl);
184185
return new WriteBatch(firestoreImpl, writes =>
185-
getDatastore(firestoreImpl).then(datastore =>
186-
invokeCommitRpc(datastore, writes)
187-
)
186+
invokeCommitRpc(datastore, writes)
188187
);
189188
}

0 commit comments

Comments
 (0)