From 06886ed89017b0c509ad2bb9ac35265d8b205c9d Mon Sep 17 00:00:00 2001 From: Erdem Yerebasmaz Date: Sun, 14 Apr 2024 16:52:40 +0300 Subject: [PATCH] Display error message if LSP cannot open a new channel on LN Address page --- .../ln_address/ln_address_fee_message.dart | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/routes/ln_address/ln_address_fee_message.dart b/lib/routes/ln_address/ln_address_fee_message.dart index f4a050771..fb253f49b 100644 --- a/lib/routes/ln_address/ln_address_fee_message.dart +++ b/lib/routes/ln_address/ln_address_fee_message.dart @@ -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().state; final lspState = context.watch().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),