Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display error when invoice is paid #627

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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();
erdemyerebasmaz marked this conversation as resolved.
Show resolved Hide resolved
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
Loading