From a27218dcb7ab518be231792af82475c2e58758ee Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 26 Jul 2022 10:22:09 +0200 Subject: [PATCH] qml: copy/share the correct data, fix UI issue when no description --- electrum/gui/qml/components/RequestDialog.qml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/electrum/gui/qml/components/RequestDialog.qml b/electrum/gui/qml/components/RequestDialog.qml index 325978180..8c4a3c49a 100644 --- a/electrum/gui/qml/components/RequestDialog.qml +++ b/electrum/gui/qml/components/RequestDialog.qml @@ -151,8 +151,8 @@ Dialog { icon.color: 'transparent' text: 'Copy' onClicked: { - if (modelItem.is_lightning) - AppController.textToClipboard(modelItem.lightning_invoice) + if (modelItem.is_lightning && rootLayout.state == 'bolt11') + AppController.textToClipboard(_bolt11) else AppController.textToClipboard(_bip21uri) @@ -163,8 +163,8 @@ Dialog { text: 'Share' onClicked: { enabled = false - if (modelItem.is_lightning) - AppController.doShare(modelItem.lightning_invoice, qsTr('Payment Request')) + if (modelItem.is_lightning && rootLayout.state == 'bolt11') + AppController.doShare(_bolt11, qsTr('Payment Request')) else AppController.doShare(_bip21uri, qsTr('Payment Request')) enabled = true @@ -192,15 +192,14 @@ Dialog { text: qsTr('Amount') } RowLayout { + visible: modelItem.amount.satsInt != 0 Label { - visible: modelItem.amount.satsInt != 0 text: Config.formatSats(modelItem.amount) font.family: FixedFont font.pixelSize: constants.fontSizeLarge font.bold: true } Label { - visible: modelItem.amount.satsInt != 0 text: Config.baseUnit color: Material.accentColor font.pixelSize: constants.fontSizeLarge @@ -208,7 +207,6 @@ Dialog { Label { id: fiatValue - visible: modelItem.amount.satsInt != 0 Layout.fillWidth: true text: Daemon.fx.enabled ? '(' + Daemon.fx.fiatValue(modelItem.amount, false) + ' ' + Daemon.fx.fiatCurrency + ')'