From c2f5b3ba6b33893bb13cefdd29b764befa4bb5ee Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 11 Aug 2025 16:42:50 +0200 Subject: [PATCH] qml: lnurlw: bind walletCanReceive to in-liquidity binds the walletCanReceive variable to the available inbound liquidity so the withdraw button gets enabled when the channels reconnect if the user opens a lnurlw request dialog before the channels have connected. --- .../components/LnurlWithdrawRequestDialog.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml b/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml index d923866f2..4bbcab99b 100644 --- a/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml +++ b/electrum/gui/qml/components/LnurlWithdrawRequestDialog.qml @@ -32,9 +32,19 @@ ElDialog { property bool valid: amountValid Component.onCompleted: { - // Initialize walletCanReceive (instead of binding wallet.lightningCanReceive.satsInt) - // to prevent binding loop if wallet.lightningCanReceive.satsInt changes - walletCanReceive = wallet.lightningCanReceive.satsInt + dialog.walletCanReceive = wallet.lightningCanReceive.satsInt + } + + Connections { + // assign walletCanReceive directly to prevent a binding loop + target: wallet + function onLightningCanReceiveChanged() { + if (!requestDetails.busy) { + // don't assign while busy to prevent the view from changing while receiving + // the incoming payment + dialog.walletCanReceive = wallet.lightningCanReceive.satsInt + } + } } ColumnLayout {