Skip to content

Commit

Permalink
Merge pull request #660 from breez/ok300-fix-lnurl-w
Browse files Browse the repository at this point in the history
Fix handling of LNURLw response types
  • Loading branch information
ok300 authored Oct 7, 2023
2 parents 8180e13 + 3a7e8ee commit 32d95ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/routes/lnurl/withdraw/lnurl_withdraw_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,12 @@ class _LNURLWithdrawDialogState extends State<LNURLWithdrawDialog> with SingleTi
amountSats: widget.amountSats,
description: description,
);
if (resp is sdk.LnUrlWithdrawSuccessData) {
final paymentHash = (resp as sdk.LnUrlWithdrawSuccessData).invoice.paymentHash;
if (resp is sdk.LnUrlWithdrawResult_Ok) {
final paymentHash = resp.data.invoice.paymentHash;
_log.v("LNURL withdraw success for $paymentHash");
return const LNURLPageResult(protocol: LnUrlProtocol.Withdraw);
} else if (resp is sdk.LnUrlErrorData) {
final reason = (resp as sdk.LnUrlErrorData).reason;
} else if (resp is sdk.LnUrlWithdrawResult_ErrorStatus) {
final reason = resp.data.reason;
_log.v("LNURL withdraw failed: $reason");
return LNURLPageResult(
protocol: LnUrlProtocol.Withdraw,
Expand Down

0 comments on commit 32d95ab

Please sign in to comment.