From 2754b7750f057f13d5cb9aefa33205a03a280d52 Mon Sep 17 00:00:00 2001 From: Richard Holzeis Date: Thu, 21 Sep 2023 08:50:49 +0200 Subject: [PATCH] fix: Add dedicated message if payment failed Note, this is just a quick patch for that scenario. We need to rework that dialog to wait for the payment to be successful or not, and not just depend whether we were able to submit the payment. --- mobile/lib/features/wallet/wallet_screen.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mobile/lib/features/wallet/wallet_screen.dart b/mobile/lib/features/wallet/wallet_screen.dart index abfd697d7..e9f5d5ea9 100644 --- a/mobile/lib/features/wallet/wallet_screen.dart +++ b/mobile/lib/features/wallet/wallet_screen.dart @@ -5,17 +5,17 @@ import 'package:get_10101/common/amount_text.dart'; import 'package:get_10101/common/fiat_text.dart'; import 'package:get_10101/common/submission_status_dialog.dart'; import 'package:get_10101/common/value_data_row.dart'; -import 'package:get_10101/features/wallet/domain/wallet_type.dart'; import 'package:get_10101/features/trade/position_change_notifier.dart'; -import 'package:get_10101/features/wallet/seed_screen.dart'; -import 'package:get_10101/features/wallet/send_payment_change_notifier.dart'; -import 'package:get_10101/util/preferences.dart'; import 'package:get_10101/features/wallet/balance_row.dart'; import 'package:get_10101/features/wallet/create_invoice_screen.dart'; import 'package:get_10101/features/wallet/domain/wallet_history.dart'; -import 'package:get_10101/features/wallet/wallet_theme.dart'; +import 'package:get_10101/features/wallet/domain/wallet_type.dart'; +import 'package:get_10101/features/wallet/seed_screen.dart'; +import 'package:get_10101/features/wallet/send_payment_change_notifier.dart'; import 'package:get_10101/features/wallet/send_screen.dart'; import 'package:get_10101/features/wallet/wallet_change_notifier.dart'; +import 'package:get_10101/features/wallet/wallet_theme.dart'; +import 'package:get_10101/util/preferences.dart'; import 'package:get_10101/util/send_receive_icons.dart'; import 'package:go_router/go_router.dart'; import 'package:provider/provider.dart'; @@ -84,7 +84,9 @@ class _WalletScreenState extends State { Padding( padding: const EdgeInsets.only(top: 20, left: 10, right: 10, bottom: 5), child: Text( - "Your Payment will be shown up in the wallet history automatically once it has been processed!", + PendingPaymentState.failed == state + ? "Failed to submit your payment. Please make sure that you have sufficient funds that the receiver is able to receive." + : "Your Payment will be shown up in the wallet history automatically once it has been processed!", style: DefaultTextStyle.of(context).style.apply(fontSizeFactor: 1.0)), ) ],