Merge remote-tracking branch 'origin/firestore-transactions' into firestore-transactions
This commit is contained in:
commit
c792cd9146
|
@ -263,7 +263,7 @@ public class RNFirebaseFirestore extends ReactContextBaseJavaModule {
|
||||||
.runTransaction(new Transaction.Function<Void>() {
|
.runTransaction(new Transaction.Function<Void>() {
|
||||||
@Override
|
@Override
|
||||||
public Void apply(@NonNull Transaction transaction) throws FirebaseFirestoreException {
|
public Void apply(@NonNull Transaction transaction) throws FirebaseFirestoreException {
|
||||||
transactionHandler.setFirestoreTransaction(transaction);
|
transactionHandler.resetState(transaction);
|
||||||
|
|
||||||
// emit the update cycle to JS land using an async task
|
// emit the update cycle to JS land using an async task
|
||||||
// otherwise it gets blocked by the pending lock await
|
// otherwise it gets blocked by the pending lock await
|
||||||
|
|
|
@ -51,11 +51,12 @@ class RNFirebaseFirestoreTransactionHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keep a ref to the Transaction instance.
|
* Reset handler state - clears command buffer + updates to new Transaction instance
|
||||||
*
|
*
|
||||||
* @param firestoreTransaction
|
* @param firestoreTransaction
|
||||||
*/
|
*/
|
||||||
void setFirestoreTransaction(Transaction firestoreTransaction) {
|
void resetState(Transaction firestoreTransaction) {
|
||||||
|
this.commandBuffer = null;
|
||||||
this.firestoreTransaction = firestoreTransaction;
|
this.firestoreTransaction = firestoreTransaction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue