Skip to content

Commit

Permalink
Display error message if LSP cannot open a new channel on LN Address …
Browse files Browse the repository at this point in the history
…page
  • Loading branch information
erdemyerebasmaz committed Apr 14, 2024
1 parent 906ecc9 commit 06886ed
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/routes/ln_address/ln_address_fee_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,29 @@ class LnAddressFeeMessage extends StatelessWidget {

@override
Widget build(BuildContext context) {
final texts = context.texts();
final themeData = Theme.of(context);
final accountState = context.read<AccountBloc>().state;
final lspState = context.watch<LSPBloc>().state;
final isChannelOpeningAvailable = lspState?.isChannelOpeningAvailable ?? false;
final openingFeeParams = lspState?.lspInfo?.openingFeeParamsList.values.first;

if (!isChannelOpeningAvailable && accountState.maxInboundLiquidity <= 0) {
return WarningBox(
boxPadding: const EdgeInsets.fromLTRB(16, 30, 16, 16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
texts.lsp_error_cannot_open_channel,
style: themeData.textTheme.titleLarge,
textAlign: TextAlign.center,
),
],
),
);
}

return isChannelOpeningAvailable
? WarningBox(
boxPadding: const EdgeInsets.fromLTRB(16, 30, 16, 16),
Expand Down

0 comments on commit 06886ed

Please sign in to comment.