fix(@desktop/settings-contacts): it is not possible to add new contacts after the first one is added

Fixes #4658
This commit is contained in:
Sale Djenic 2022-02-03 11:39:46 +01:00 committed by saledjenic
parent c85734f08d
commit 0b3cafdbc4
3 changed files with 12 additions and 11 deletions

View File

@ -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,

View File

@ -213,7 +213,7 @@ Item {
Connections {
target: root.contactsStore.mainModuleInst
onResolvedENS: function (resolvedPubKey) {
onResolvedENS: {
if (resolvedPubKey === "") {
searchResults.pubKey = ""
searchResults.showProfileNotFoundMessage = true

View File

@ -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