1
0

fix: qml: update tx label on detailsChanged signal

when setting a transaction label in the qml
`LightningPaymentDetails` or `TxDetails` dialogs which get opened
directly by the `ReceiveDialog` (`onRequestPaid`) the label is not applied on the main
transaction list as no callback for `detailsChanged` is registered which
gets called when the label changes. As a result the label is only
visible after the main list gets reloaded (e.g. restart).
This commit adds callbacks for `detailsChanged` to fix this.
This commit is contained in:
f321x
2025-07-07 15:44:07 +02:00
parent bbac398d1b
commit 86dd267d15

View File

@@ -642,11 +642,21 @@ Item {
onRequestPaid: {
close()
var capturedHistoryModel = Daemon.currentWallet.historyModel
if (isLightning) {
app.stack.push(Qt.resolvedUrl('LightningPaymentDetails.qml'), {'key': key})
var page = app.stack.push(Qt.resolvedUrl('LightningPaymentDetails.qml'), {'key': key})
var capturedKey = key
page.detailsChanged.connect(function() {
capturedHistoryModel.updateTxLabel(capturedKey, page.label)
}
)
} else {
let paidTxid = getPaidTxid()
app.stack.push(Qt.resolvedUrl('TxDetails.qml'), {'txid': paidTxid})
var page = app.stack.push(Qt.resolvedUrl('TxDetails.qml'), {'txid': paidTxid})
page.detailsChanged.connect(function() {
capturedHistoryModel.updateTxLabel(paidTxid, page.label)
}
)
}
}
onClosed: destroy()