From 86dd267d15f969405402078784cfce2653ba5323 Mon Sep 17 00:00:00 2001 From: f321x Date: Mon, 7 Jul 2025 15:44:07 +0200 Subject: [PATCH] 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. --- electrum/gui/qml/components/WalletMainView.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/electrum/gui/qml/components/WalletMainView.qml b/electrum/gui/qml/components/WalletMainView.qml index af2cc7972..3ebb5b72b 100644 --- a/electrum/gui/qml/components/WalletMainView.qml +++ b/electrum/gui/qml/components/WalletMainView.qml @@ -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()