diff --git a/lib/src/screens/exchange_trade/exchange_trade_page.dart b/lib/src/screens/exchange_trade/exchange_trade_page.dart index 807bbbf51..def6238a3 100644 --- a/lib/src/screens/exchange_trade/exchange_trade_page.dart +++ b/lib/src/screens/exchange_trade/exchange_trade_page.dart @@ -296,7 +296,7 @@ class ExchangeTradeState extends State { }), bottomSection: Observer( builder: (_) => tradeStore.trade.from == CryptoCurrency.xmr && - !(sendStore.state is TransactionCreatedSuccessfully) + !(sendStore.state is TransactionCommitted) ? Container( padding: EdgeInsets.only(top: 20.0, bottom: 20.0), child: LoadingPrimaryButton( @@ -351,6 +351,33 @@ class ExchangeTradeState extends State { } if (state is TransactionCreatedSuccessfully) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: Text(S.of(context).confirm_sending), + content: Text(S.of(context).commit_transaction_amount_fee( + sendStore.pendingTransaction.amount, + sendStore.pendingTransaction.fee)), + actions: [ + FlatButton( + child: Text(S.of(context).ok), + onPressed: () { + Navigator.of(context).pop(); + sendStore.commitTransaction(); + }), + FlatButton( + child: Text(S.of(context).cancel), + onPressed: () => Navigator.of(context).pop(), + ) + ], + ); + }); + }); + } + + if (state is TransactionCommitted) { WidgetsBinding.instance.addPostFrameCallback((_) { showDialog( context: context, diff --git a/lib/src/screens/faq/faq_page.dart b/lib/src/screens/faq/faq_page.dart index 182e20a92..c96264f73 100644 --- a/lib/src/screens/faq/faq_page.dart +++ b/lib/src/screens/faq/faq_page.dart @@ -7,6 +7,7 @@ import 'package:cake_wallet/src/stores/settings/settings_store.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; class FaqPage extends BasePage { + @override String get title => S.current.faq; @override @@ -21,24 +22,18 @@ class FaqPage extends BasePage { final itemChild = faqItems[index]["answer"].toString(); return ExpansionTile( - title: Text( - itemTitle - ), + title: Text(itemTitle), children: [ Row( mainAxisAlignment: MainAxisAlignment.start, children: [ Expanded( child: Container( - padding: EdgeInsets.only( - left: 15.0, - right: 15.0 - ), - child: Text( - itemChild, - ), - ) - ) + padding: EdgeInsets.only(left: 15.0, right: 15.0), + child: Text( + itemChild, + ), + )) ], ) ], @@ -83,4 +78,4 @@ class FaqPage extends BasePage { return 'assets/faq/faq_en.json'; } } -} \ No newline at end of file +} diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index 50b8d675c..9880b3459 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -402,7 +402,7 @@ class SendFormState extends State { borderColor: Theme.of(context).accentTextTheme.button.decorationColor, isLoading: sendStore.state is CreatingTransaction || - sendStore.state is TransactionCommitted); + sendStore.state is TransactionCommiting); })); } @@ -461,6 +461,33 @@ class SendFormState extends State { } if (state is TransactionCreatedSuccessfully) { + WidgetsBinding.instance.addPostFrameCallback((_) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: Text(S.of(context).confirm_sending), + content: Text(S.of(context).commit_transaction_amount_fee( + sendStore.pendingTransaction.amount, + sendStore.pendingTransaction.fee)), + actions: [ + FlatButton( + child: Text(S.of(context).ok), + onPressed: () { + Navigator.of(context).pop(); + sendStore.commitTransaction(); + }), + FlatButton( + child: Text(S.of(context).cancel), + onPressed: () => Navigator.of(context).pop(), + ) + ], + ); + }); + }); + } + + if (state is TransactionCommitted) { WidgetsBinding.instance.addPostFrameCallback((_) { showDialog( context: context, diff --git a/lib/src/stores/send/send_store.dart b/lib/src/stores/send/send_store.dart index bc9972b62..494927857 100644 --- a/lib/src/stores/send/send_store.dart +++ b/lib/src/stores/send/send_store.dart @@ -26,12 +26,6 @@ abstract class SendStoreBase with Store { _pendingTransaction = null; _cryptoNumberFormat = NumberFormat()..maximumFractionDigits = 12; _fiatNumberFormat = NumberFormat()..maximumFractionDigits = 2; - - reaction((_) => this.state, (SendingState state) async { - if (state is TransactionCreatedSuccessfully) { - await commitTransaction(); - } - }); } WalletService walletService; @@ -89,7 +83,9 @@ abstract class SendStoreBase with Store { Future commitTransaction() async { try { final transactionId = _pendingTransaction.hash; + state = TransactionCommiting(); await _pendingTransaction.commit(); + state = TransactionCommitted(); if (settingsStore.shouldSaveRecipientAddress) { await transactionDescriptions.add(TransactionDescription(