1
0

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.
This commit is contained in:
f321x
2025-08-11 16:42:50 +02:00
parent b90090e2dd
commit c2f5b3ba6b

View File

@@ -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 {