fix(@desktop/profile): handle empty text in add contact properly
fixes #3046 also fix the fact that the query is only triggered when the text is changed vs when pressing any key
This commit is contained in:
parent
9893dbb00c
commit
b3ea8f9502
|
@ -159,18 +159,18 @@ Item {
|
|||
placeholderText: qsTrId("enter-contact-code")
|
||||
customHeight: 44
|
||||
fontPixelSize: 15
|
||||
Keys.onReleased: {
|
||||
if (text !== "") {
|
||||
if (!addContactModal.validate(addContactSearchInput.text)) {
|
||||
searchResults.reset();
|
||||
contactsContainer.isPending = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Qt.callLater(addContactModal.lookupContact, addContactSearchInput.text);
|
||||
} else {
|
||||
addContactModal.validationError = "";
|
||||
onTextEdited: {
|
||||
if (addContactSearchInput.text === "") {
|
||||
searchResults.reset();
|
||||
return;
|
||||
}
|
||||
if (!addContactModal.validate(addContactSearchInput.text)) {
|
||||
searchResults.reset();
|
||||
contactsContainer.isPending = false;
|
||||
return;
|
||||
}
|
||||
|
||||
Qt.callLater(addContactModal.lookupContact, addContactSearchInput.text);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue