fix: add contact using status ens name
This commit is contained in:
parent
4b7769c391
commit
2ac67f95aa
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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 + " • "
|
||||
|
|
Loading…
Reference in New Issue