Skip to content

Commit

Permalink
Merge pull request #627 from breez/paid-invoice
Browse files Browse the repository at this point in the history
display error when invoice is paid
  • Loading branch information
ubbabeck authored Sep 21, 2023
2 parents 8dd1360 + 1801b2c commit dd8d828
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/widgets/payment_dialogs/processing_payment_dialog.dart
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -85,6 +89,7 @@ class ProcessingPaymentDialogState extends State<ProcessingPaymentDialog>

_payAndClose() {
final navigator = Navigator.of(context);
final texts = getSystemAppLocalizations();
widget.paymentFunc().then((payResult) async {
await _animateClose();
if (widget.isLnurlPayment) {
Expand All @@ -98,6 +103,12 @@ class ProcessingPaymentDialogState extends State<ProcessingPaymentDialog>
if (widget.isLnurlPayment) {
navigator.pop(err);
}
if (err is FfiException) {
if (_currentRoute != null && _currentRoute!.isActive) {
navigator.removeRoute(_currentRoute!);
}
showFlushbar(context, message: extractExceptionMessage(err, texts));
}
});
}

Expand Down

0 comments on commit dd8d828

Please sign in to comment.