diff options
| author | tobtoht <tob@featherwallet.org> | 2026-04-22 18:39:58 +0000 |
|---|---|---|
| committer | tobtoht <tob@featherwallet.org> | 2026-04-22 18:39:58 +0000 |
| commit | f6c0b66c5aa4546338864be519cd5d22159447a6 (patch) | |
| tree | 79f582469f1e7899cad054ea5910f7617e13c28b | |
| parent | bb4bc4a77ecf4263311cf7b139cd15be28050d3e (diff) | |
| parent | b31fae765f3e898083043735ca0954731eb10cf1 (diff) | |
| download | monzero-gui-f6c0b66c5aa4546338864be519cd5d22159447a6.tar.gz monzero-gui-f6c0b66c5aa4546338864be519cd5d22159447a6.tar.xz monzero-gui-f6c0b66c5aa4546338864be519cd5d22159447a6.zip | |
Merge pull request #4579
b31fae7 Transfer: disable offline tx creation with long payment id (selsta)
| -rw-r--r-- | pages/Transfer.qml | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/pages/Transfer.qml b/pages/Transfer.qml index 66e0b66b..48ce4b82 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -81,6 +81,19 @@ Rectangle { } property string startLinkText: "<style type='text/css'>a {text-decoration: none; color: #FF6C3C; font-size: 14px;}</style><a href='#'>(%1)</a>".arg(qsTr("Start daemon")) + translationManager.emptyString property bool warningLongPidDescription: descriptionLine.text.match(/^[0-9a-f]{64}$/i) + property bool paymentIdBlocked: paymentIdCheckbox.checked || warningLongPidDescription + property bool hasTransferWarnings: warningContent !== "" || paymentIdBlocked + property bool hasValidTransferInfo: !recipientModel.hasEmptyAddress() + && !recipientModel.hasEmptyAmount() + && !recipientModel.hasInvalidAddress() + && recipientModel.getAmountTotal() <= appWindow.getUnlockedBalance() + property bool canSendTransaction: !sendButtonWarningBox.visible + && !hasTransferWarnings + && hasValidTransferInfo + property bool canCreateOfflineTx: appWindow.viewOnly + && appWindow.daemonSynced + && !hasTransferWarnings + && hasValidTransferInfo Clipboard { id: clipboard } @@ -819,7 +832,7 @@ Rectangle { text: qsTr("Long payment IDs are obsolete. \ Long payment IDs were not encrypted on the blockchain and would harm your privacy. \ If the party you're sending to still requires a long payment ID, please notify them.") + translationManager.emptyString; - visible: paymentIdCheckbox.checked || warningLongPidDescription + visible: root.paymentIdBlocked } MoneroComponents.WarningBox { @@ -834,7 +847,7 @@ Rectangle { rightIcon: "qrc:///images/rightArrow.png" Layout.topMargin: 4 text: qsTr("Send") + translationManager.emptyString - enabled: !sendButtonWarningBox.visible && !warningContent && !recipientModel.hasEmptyAddress() && !paymentIdWarningBox.visible + enabled: root.canSendTransaction onClicked: { console.log("Transfer: paymentClicked") var priority = priorityModelV5.get(priorityDropdown.currentIndex).priority @@ -844,13 +857,6 @@ Rectangle { } } } - - function checkInformation() { - return !recipientModel.hasEmptyAmount() && - recipientModel.getAmountTotal() <= appWindow.getUnlockedBalance() && - !recipientModel.hasInvalidAddress(); - } - } // pageRoot ColumnLayout { @@ -934,7 +940,7 @@ Rectangle { visible: persistentSettings.transferShowAdvanced && appWindow.walletMode >= 2 title: qsTr("Offline transaction signing") + translationManager.emptyString button1.text: qsTr("Create") + translationManager.emptyString - button1.enabled: appWindow.viewOnly && pageRoot.checkInformation() && appWindow.daemonSynced + button1.enabled: root.canCreateOfflineTx button1.onClicked: { console.log("Transfer: saveTx Clicked") var priority = priorityModelV5.get(priorityDropdown.currentIndex).priority @@ -956,7 +962,7 @@ Rectangle { } tooltip: { var errorMessage = ""; - if (appWindow.viewOnly && !pageRoot.checkInformation()) { + if (appWindow.viewOnly && !root.hasValidTransferInfo) { errorMessage = "<p class='orange'>" + qsTr("* To create a transaction file, please enter address and amount above") + "</p>"; } var header = qsTr("Spend XMR from a cold (offline) wallet") + translationManager.emptyString; |
