diff --git a/src/app/profile/views/contacts.nim b/src/app/profile/views/contacts.nim index b22214c2ab..37493dda61 100644 --- a/src/app/profile/views/contacts.nim +++ b/src/app/profile/views/contacts.nim @@ -119,15 +119,19 @@ QtObject: id = status_ens.pubkey(id) id - proc ensResolved(self: ContactsView, id: string) {.slot.} = - let contact = self.status.contacts.getContactByID(id) + proc ensWasResolved*(self: ContactsView, resolvedPubKey: string) {.signal.} + proc ensResolved(self: ContactsView, id: string) {.slot.} = + self.ensWasResolved(id) + let contact = self.status.contacts.getContactByID(id) + if contact != nil: self.contactToAdd = contact else: self.contactToAdd = Profile( + address: id, username: "", - alias: "", + alias: generateAlias(id), ensName: "", ensVerified: false ) diff --git a/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml b/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml index 46790191f7..2df896c5b9 100644 --- a/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml +++ b/ui/app/AppLayouts/Profile/Sections/ContactsContainer.qml @@ -189,6 +189,17 @@ Item { visible: !contactsContainer.isPending && !!!profileModel.contacts.contactToAddUsername } + Connections { + target: profileModel.contacts + onEnsWasResolved: { + if(addContactSearchInput.text !== "" && !Utils.isHex(addContactSearchInput.text) && resolvedPubKey !== ""){ + contactUsername.text = Qt.binding(function () { + return chatsModel.formatENSUsername(addContactSearchInput.text) + " • " + }); + } + } + } + StyledText { id: contactUsername text: profileModel.contacts.contactToAddUsername + " • "