From 1801b2cbc63642bb8ce3c8240888141332ba1100 Mon Sep 17 00:00:00 2001 From: ruben beck Date: Fri, 15 Sep 2023 09:31:01 +0200 Subject: [PATCH] display error when invoice is paid --- .../payment_dialogs/processing_payment_dialog.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/widgets/payment_dialogs/processing_payment_dialog.dart b/lib/widgets/payment_dialogs/processing_payment_dialog.dart index 906c1e262..90df45962 100644 --- a/lib/widgets/payment_dialogs/processing_payment_dialog.dart +++ b/lib/widgets/payment_dialogs/processing_payment_dialog.dart @@ -1,9 +1,13 @@ import 'dart:async'; +import 'package:breez_translations/breez_translations_locales.dart'; +import 'package:c_breez/utils/exceptions.dart'; +import 'package:c_breez/widgets/flushbar.dart'; import 'package:c_breez/widgets/payment_dialogs/payment_request_dialog.dart'; import 'package:c_breez/widgets/payment_dialogs/processing_payment/processing_payment_animated_content.dart'; import 'package:c_breez/widgets/payment_dialogs/processing_payment/processing_payment_content.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_rust_bridge/flutter_rust_bridge.dart'; const _kPaymentListItemHeight = 72.0; @@ -85,6 +89,7 @@ class ProcessingPaymentDialogState extends State _payAndClose() { final navigator = Navigator.of(context); + final texts = getSystemAppLocalizations(); widget.paymentFunc().then((payResult) async { await _animateClose(); if (widget.isLnurlPayment) { @@ -98,6 +103,12 @@ class ProcessingPaymentDialogState extends State if (widget.isLnurlPayment) { navigator.pop(err); } + if (err is FfiException) { + if (_currentRoute != null && _currentRoute!.isActive) { + navigator.removeRoute(_currentRoute!); + } + showFlushbar(context, message: extractExceptionMessage(err, texts)); + } }); }