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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user