fix(@desktop/wallet): correct error message when adding own ENS name to saved addresses

#8114
This commit is contained in:
Dario Gabriel Lipicar 2022-11-11 15:18:09 -03:00 committed by dlipicar
parent 557703543c
commit 47f7373838
5 changed files with 7 additions and 2 deletions

View File

@ -100,6 +100,7 @@ StatusDialog {
}
readOnly: root.edit
wrongInputValidationError: qsTr("Please enter a valid ENS name OR Ethereum Address")
ownAddressError: qsTr("Can't add yourself as a saved address")
}
}

View File

@ -21,6 +21,7 @@ Item {
property int parentWidth
property bool addContactEnabled: true
property alias wrongInputValidationError: contactFieldAndList.wrongInputValidationError
property alias ownAddressError: contactFieldAndList.ownAddressError
height: contactFieldAndList.chatKey.height

View File

@ -37,6 +37,7 @@ Item {
property bool hideCommunityMembers: false
property bool addContactEnabled: true
property string wrongInputValidationError: qsTr("Enter a valid chat key or ENS username");
property string ownAddressError: qsTr("Can't chat with yourself");
readonly property var resolveENS: Backpressure.debounce(root, 500, function (ensName) {
noContactsRect.visible = false
@ -51,7 +52,7 @@ Item {
pubKey = ""
ensUsername = "";
} else if (RootStore.userProfileInst.pubKey === chatKey.text) {
root.validationError = qsTr("Can't chat with yourself");
root.validationError = ownAddressError;
} else {
root.validationError = "";
}
@ -126,7 +127,7 @@ Item {
searchResults.showProfileNotFoundMessage = root.showContactList
} else {
if (userProfile.pubKey === resolvedPubKey) {
root.validationError = qsTr("Can't chat with yourself");
root.validationError = ownAddressError;
} else {
chatKey.hasValidSearchResult = true
searchResults.username = chatKey.text.trim()

View File

@ -27,6 +27,7 @@ Item {
property bool readOnly: false
readonly property string addressValidationError: qsTr("Invalid ethereum address")
property alias wrongInputValidationError: inpAddress.wrongInputValidationError
property alias ownAddressError: inpAddress.ownAddressError
property bool isValid: false
property bool isSelectorVisible: true
property bool addContactEnabled: true

View File

@ -101,6 +101,7 @@ StatusDialog {
}
readOnly: root.edit || root.addAddress
wrongInputValidationError: qsTr("Please enter a valid ENS name OR Ethereum Address")
ownAddressError: qsTr("Can't add yourself as a saved address")
}
}