diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 01da18c..451ed5e 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -342,7 +342,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; STRIP_STYLE = "non-global"; @@ -426,7 +426,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -477,7 +477,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; STRIP_STYLE = "non-global"; @@ -568,4 +568,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} +} \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 2d9fe98..9084763 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -70,5 +70,7 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + diff --git a/lib/contact.dart b/lib/contact.dart index c4f42fa..9040c98 100644 --- a/lib/contact.dart +++ b/lib/contact.dart @@ -90,13 +90,12 @@ class ContactsState extends State { } _onCommit() async { - final approve = await showMessageBox(context, S.of(context).saveToBlockchain, - S.of(context).areYouSureYouWantToSaveYourContactsIt(activeCoin().ticker), - S.of(context).ok); - if (approve) { - final tx = await WarpApi.commitUnsavedContacts(settings.anchorOffset); - showSnackBar(S.of(context).txId(tx)); - contacts.markContactsSaved(active.coin, true); + try { + final txPlan = WarpApi.commitUnsavedContacts(settings.anchorOffset); + Navigator.of(context).pushNamed('/txplan', arguments: txPlan); + } + on String catch (msg) { + showSnackBar(msg); } } } diff --git a/lib/dualmoneyinput.dart b/lib/dualmoneyinput.dart index 3aef83e..51da0bc 100644 --- a/lib/dualmoneyinput.dart +++ b/lib/dualmoneyinput.dart @@ -50,6 +50,7 @@ class DualMoneyInputState extends State { final amount = amountToString(initialValue, precision(useMillis)); coinAmountController.text = amount; _updateFxRate(); + _updateSlider(); } void _updateFxRate() { diff --git a/lib/main.dart b/lib/main.dart index 87452db..4c12a44 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -770,26 +770,14 @@ Future authenticate(BuildContext context, String reason) async { } Future shieldTAddr(BuildContext context) async { - await showDialog( - context: context, - barrierDismissible: false, - builder: (context) => - AlertDialog( - title: Text(S - .of(context) - .shieldTransparentBalance), - content: Text(S - .of(context) - .doYouWantToTransferYourEntireTransparentBalanceTo( - activeCoin().ticker)), - actions: confirmButtons(context, () async { - final s = S.of(context); - Navigator.of(context).pop(); - showSnackBar(s.shieldingInProgress, autoClose: true); - final txid = await WarpApi.shieldTAddr(active.coin, active.id, active.tbalance, settings.anchorOffset); - showSnackBar(s.txId(txid)); - })), - ); + try { + final txPlan = WarpApi.shieldTAddr( + active.coin, active.id, active.tbalance, settings.anchorOffset); + Navigator.of(context).pushNamed('/txplan', arguments: txPlan); + } + on String catch (msg) { + showSnackBar(msg); + } } Future shareCsv(List data, String filename, String title) async { diff --git a/lib/send.dart b/lib/send.dart index bbe160d..56c94e3 100644 --- a/lib/send.dart +++ b/lib/send.dart @@ -60,6 +60,7 @@ class SendState extends State { _replyTo = false; _subjectController.clear(); _amountKey.currentState?.clear(); + active.setDraftRecipient(null); }); } @@ -75,7 +76,6 @@ class SendState extends State { _replyTo = draftRecipient.reply_to; _subjectController.text = draftRecipient.subject; _memoInitialized = true; - active.setDraftRecipient(null); } if (widget.args?.contact != null) @@ -113,6 +113,17 @@ class SendState extends State { Future(_loadTemplates); } + @override + void deactivate() { + final form = _formKey.currentState; + if (form != null) { + form.save(); + final recipient = _getRecipient(); + active.setDraftRecipient(recipient); + } + super.deactivate(); + } + @override void dispose() { _newBlockAutorunDispose?.call(); @@ -371,26 +382,30 @@ class SendState extends State { } } + Recipient _getRecipient() { + final amount = amountInput?.amount ?? 0; + final feeIncluded = amountInput?.feeIncluded ?? false; + final memo = _memoController.text; + final subject = _subjectController.text; + final recipient = Recipient( + _address, + amount, + feeIncluded, + _replyTo, + subject, + memo, + 0, + ); + return recipient; + } + void _onSend() async { final form = _formKey.currentState; if (form == null) return; if (form.validate()) { form.save(); - final amount = amountInput?.amount ?? 0; - final feeIncluded = amountInput?.feeIncluded ?? false; - final memo = _memoController.text; - final subject = _subjectController.text; - final recipient = Recipient( - _address, - amount, - feeIncluded, - _replyTo, - subject, - memo, - 0, - ); - active.setDraftRecipient(recipient); + final recipient = _getRecipient(); if (!widget.isMulti) // send closes the page diff --git a/lib/txplan.dart b/lib/txplan.dart index a0e1221..f2766fd 100644 --- a/lib/txplan.dart +++ b/lib/txplan.dart @@ -105,9 +105,11 @@ class TxPlanPage extends StatelessWidget { final res = await WarpApi.signOnly( active.coin, active.id, plan, (progress) { // TODO progressPort.sendPort.send(progress); + // Orchard builder does not support progress reporting yet }); // TODO progressPort.sendPort.send(0); active.setBanner(""); + active.setDraftRecipient(null); if (settings.qrOffline) { navigatorKey.currentState?.pushReplacementNamed( '/showRawTx', arguments: res); diff --git a/native/zcash-sync b/native/zcash-sync index 893e52f..cd1d84b 160000 --- a/native/zcash-sync +++ b/native/zcash-sync @@ -1 +1 @@ -Subproject commit 893e52fe204f77abed001ac16676949c58130738 +Subproject commit cd1d84b25d560644ab8933103a881e8a6b3781c7 diff --git a/packages/warp_api_ffi/lib/warp_api.dart b/packages/warp_api_ffi/lib/warp_api.dart index c8e3ea5..1838bfe 100644 --- a/packages/warp_api_ffi/lib/warp_api.dart +++ b/packages/warp_api_ffi/lib/warp_api.dart @@ -213,9 +213,9 @@ class WarpApi { return txId; } - static Future shieldTAddr(int coin, int account, int amount, int anchorOffset) async { - final txId = await compute(shieldTAddrIsolateFn, ShieldTAddrParams(coin, account, amount, anchorOffset)); - return txId; + static String shieldTAddr(int coin, int account, int amount, int anchorOffset) { + final txPlan = warp_api_lib.shield_taddr(coin, account, amount, anchorOffset); + return unwrapResultString(txPlan); } static Future scanTransparentAccounts( @@ -303,9 +303,8 @@ class WarpApi { address.toNativeUtf8().cast(), dirty ? 1 : 0); } - static Future commitUnsavedContacts(int anchorOffset) async { - return compute( - commitUnsavedContactsIsolateFn, CommitContactsParams(anchorOffset)); + static String commitUnsavedContacts(int anchorOffset) { + return unwrapResultString(warp_api_lib.commit_unsaved_contacts(anchorOffset)); } static void markMessageAsRead(int messageId, bool read) { @@ -434,11 +433,6 @@ String transferPoolsIsolateFn(TransferPoolsParams params) { return unwrapResultString(txId); } -String shieldTAddrIsolateFn(ShieldTAddrParams params) { - final txId = warp_api_lib.shield_taddr(params.coin, params.account, params.amount, params.anchorOffset); - return unwrapResultString(txId); -} - int syncHistoricalPricesIsolateFn(SyncHistoricalPricesParams params) { final now = DateTime.now(); final today = DateTime.utc(now.year, now.month, now.day); @@ -448,11 +442,6 @@ int syncHistoricalPricesIsolateFn(SyncHistoricalPricesParams params) { params.currency.toNativeUtf8().cast())); } -String commitUnsavedContactsIsolateFn(CommitContactsParams params) { - final txId = warp_api_lib.commit_unsaved_contacts(params.anchorOffset); - return unwrapResultString(txId); -} - int getTBalanceIsolateFn(GetTBalanceParams params) { return unwrapResultU64(warp_api_lib.get_taddr_balance(params.coin, params.account)); } @@ -512,21 +501,6 @@ class TransferPoolsParams { this.splitAmount, this.anchorOffset); } -class ShieldTAddrParams { - final int coin; - final int account; - final int amount; - final int anchorOffset; - - ShieldTAddrParams(this.coin, this.account, this.amount, this.anchorOffset); -} - -class CommitContactsParams { - final int anchorOffset; - - CommitContactsParams(this.anchorOffset); -} - class SyncHistoricalPricesParams { final String currency; diff --git a/pubspec.yaml b/pubspec.yaml index 481ae95..c67b723 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.2.17+335 +version: 1.2.17+336 environment: sdk: ">=2.12.0 <3.0.0"