diff --git a/components/InputMulti.qml b/components/InputMulti.qml index f7706d75..66ac1e6f 100644 --- a/components/InputMulti.qml +++ b/components/InputMulti.qml @@ -55,7 +55,7 @@ TextArea { if(addressValidation){ // js replacement for `RegExpValidator { regExp: /[0-9A-Fa-f]{95}/g }` textArea.text = textArea.text.replace(/[^a-z0-9.@]/gi,''); - var address_ok = TxUtils.checkAddress(textArea.text, appWindow.persistentSettings.nettype); + var address_ok = TxUtils.checkAddress(textArea.text, appWindow.persistentSettings.nettype) || TxUtils.isValidOpenAliasAddress(textArea.text); if(!address_ok) error = true; else error = false; TextArea.cursorPosition = textArea.text.length; diff --git a/js/TxUtils.js b/js/TxUtils.js index cdb7e719..a6cca114 100644 --- a/js/TxUtils.js +++ b/js/TxUtils.js @@ -56,3 +56,11 @@ function checkSignature(signature) { return false; } +function isValidOpenAliasAddress(address) { + address = address.trim() + var dot = address.indexOf('.') + if (dot < 0) + return false + // we can get an awful lot of valid domains, including non ASCII chars... accept anything + return true +} diff --git a/pages/Transfer.qml b/pages/Transfer.qml index bcb23d07..7098b75a 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -35,6 +35,7 @@ import moneroComponents.Wallet 1.0 import "../components" import "../components" as MoneroComponents import "." 1.0 +import "../js/TxUtils.js" as TxUtils Rectangle { @@ -51,15 +52,6 @@ Rectangle { Clipboard { id: clipboard } - function isValidOpenAliasAddress(address) { - address = address.trim() - var dot = address.indexOf('.') - if (dot < 0) - return false - // we can get an awful lot of valid domains, including non ASCII chars... accept anything - return true - } - function oa_message(text) { oaPopup.title = qsTr("OpenAlias error") + translationManager.emptyString oaPopup.text = text @@ -249,8 +241,8 @@ Rectangle { id: resolveButton width: 80 text: qsTr("Resolve") + translationManager.emptyString - visible: isValidOpenAliasAddress(addressLine.text) - enabled : isValidOpenAliasAddress(addressLine.text) + visible: TxUtils.isValidOpenAliasAddress(addressLine.text) + enabled : visible onClicked: { var result = walletManager.resolveOpenAlias(addressLine.text) if (result) {