From 8f316c005fdd7896e40476368f2d1ebd161c916f Mon Sep 17 00:00:00 2001 From: Guillaume Bernos Date: Fri, 22 Jul 2022 09:05:58 +0200 Subject: [PATCH] fix(firestore, web): fix interop on TransactionOptions --- .../cloud_firestore_web/lib/src/interop/firestore.dart | 3 ++- .../lib/src/interop/firestore_interop.dart | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore.dart b/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore.dart index f8b36ef711d0..09947aadcaef 100644 --- a/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore.dart +++ b/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore.dart @@ -104,7 +104,8 @@ class Firestore extends JsObjectWrapper { return handleThenable(firestore_interop.runTransaction( jsObject, updateFunctionWrap, - firestore_interop.TransactionOptionsJsImpl(maxAttempts))) + firestore_interop.TransactionOptionsJsImpl( + maxAttempts: maxAttempts))) .then((value) => dartify(null)); } diff --git a/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore_interop.dart b/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore_interop.dart index 4d7076c5326c..cd1b2a8f31f1 100644 --- a/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore_interop.dart +++ b/packages/cloud_firestore/cloud_firestore_web/lib/src/interop/firestore_interop.dart @@ -193,11 +193,12 @@ external PromiseJsImpl runTransaction( ]); @JS('TransactionOptions') -class TransactionOptionsJsImpl { - external factory TransactionOptionsJsImpl(num maxAttempts); +@anonymous +abstract class TransactionOptionsJsImpl { + external factory TransactionOptionsJsImpl({num maxAttempts}); /// Maximum number of attempts to commit, after which transaction fails. Default is 5. - external num get maxAttempts; + external static num get maxAttempts; } @JS()