diff --git a/src/app_service/service/contacts/async_tasks.nim b/src/app_service/service/contacts/async_tasks.nim index f369b23811..c88692b271 100644 --- a/src/app_service/service/contacts/async_tasks.nim +++ b/src/app_service/service/contacts/async_tasks.nim @@ -21,9 +21,6 @@ const lookupContactTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} = # TODO refactor those calls to use the new backend and also do it in a signle call pubkey = ens_utils.pubkey(arg.value) address = ens_utils.address(arg.value) - else: - pubkey = "" - address = "" let output = %*{ "id": pubkey, diff --git a/ui/app/AppLayouts/Profile/views/ContactsView.qml b/ui/app/AppLayouts/Profile/views/ContactsView.qml index 1dec45e551..115894fb16 100644 --- a/ui/app/AppLayouts/Profile/views/ContactsView.qml +++ b/ui/app/AppLayouts/Profile/views/ContactsView.qml @@ -213,7 +213,7 @@ Item { Connections { target: root.contactsStore.mainModuleInst - onResolvedENS: function (resolvedPubKey) { + onResolvedENS: { if (resolvedPubKey === "") { searchResults.pubKey = "" searchResults.showProfileNotFoundMessage = true diff --git a/ui/imports/shared/views/SearchResults.qml b/ui/imports/shared/views/SearchResults.qml index 1c2bff726c..29f6e2360a 100644 --- a/ui/imports/shared/views/SearchResults.qml +++ b/ui/imports/shared/views/SearchResults.qml @@ -19,6 +19,8 @@ import StatusQ.Components 0.1 Item { id: root height: 64 + width: parent.width + property bool hasExistingContacts: false property bool showProfileNotFoundMessage: false property bool loading: false @@ -28,12 +30,7 @@ Item { property string address: "" property bool resultClickable: true property bool addContactEnabled: true - - property bool isAddedContact: root.isContactAdded() - - function isContactAdded() { - return root.pubKey != "" ? Utils.getContactDetailsAsJson(root.pubKey).isContact : false - } + property bool isAddedContact: false signal resultClicked(string pubKey, bool isAddedContact, string username) signal addToContactsButtonClicked(string pubKey) @@ -44,9 +41,16 @@ Item { username = "" userAlias = "" pubKey = "" + isAddedContact = false } - width: parent.width + function isContactAdded() { + return root.pubKey != "" ? Utils.getContactDetailsAsJson(root.pubKey).isContact : false + } + + onPubKeyChanged: { + root.isAddedContact = root.isContactAdded() + } StyledText { id: nonContactsLabel