qml: InvoiceDialog: update fiat label onQuotesUpdated
What changed, and why it matters
This is a user-interface bug fix for Electrum's mobile/QML app. When opening a payment invoice quickly after starting the app, the fiat (local currency) value label could stay stuck showing 'quotes unavailable' even after exchange-rate quotes arrived. The patch makes the label refresh automatically once quotes are updated. There is no security issue here.
No security action needed. Treat as a normal UI/UX bug fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies InvoiceDialog.qml. Previously the fiatValue label bound its text property directly to Daemon.fx.fiatValue(invoice.amount, false) at construction time. If FX quotes were not yet loaded, the label would not update later. The patch removes the static binding, adds a setFiatValue() helper, calls it on component completion, and adds a Connections handler for Daemon.fx.onQuotesUpdated to refresh the label when quotes arrive. This is a reactive UI fix only.
Changed components
electrum/gui/qml/components/InvoiceDialog.qmlInspect captured patch +10 / −1
diff --git a/electrum/gui/qml/components/InvoiceDialog.qml b/electrum/gui/qml/components/InvoiceDialog.qml
index 3b036a7..f2b15b8 100644
--- a/electrum/gui/qml/components/InvoiceDialog.qml
+++ b/electrum/gui/qml/components/InvoiceDialog.qml
@@ -199,7 +199,6 @@ ElDialog {
id: fiatValue
Layout.alignment: Qt.AlignRight
visible: Daemon.fx.enabled && !_invoice_amount.isMax && !_invoice_amount.isEmpty
- text: Daemon.fx.fiatValue(invoice.amount, false)
font.pixelSize: constants.fontSizeMedium
color: constants.mutedForeground
}
@@ -501,12 +500,17 @@ ElDialog {
}
+ function setFiatValue() {
+ fiatValue.text = Daemon.fx.fiatValue(invoice.amount, false)
+ }
+
Component.onCompleted: {
if (invoice.amount.isEmpty && !invoice.status == Invoice.Expired) {
amountContainer.editmode = true
} else if (invoice.amount.isMax) {
amountMax.checked = true
}
+ setFiatValue()
if (payImmediately) {
if (invoice.canPay) {
doPay()
@@ -528,6 +532,11 @@ ElDialog {
}
}
+ Connections {
+ target: Daemon.fx
+ function onQuotesUpdated() { setFiatValue() }
+ }
+
FontMetrics {
id: amountFontMetrics
font: amountBtc.font
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.