fix(chat): fix starting 1-1 chat because of ContactList signal bug

Fixes #4421
This commit is contained in:
Jonathan Rainville 2022-01-12 12:56:41 -05:00 committed by Sale Djenic
parent 191efa5829
commit 47b139ee1c
4 changed files with 13 additions and 13 deletions

View File

@ -21,8 +21,8 @@ ModalPopup {
signal joinPrivateChat(string publicKey, string ensName)
signal profileClicked()
function doJoin(pk, ensName) {
popup.joinPrivateChat(pk, Utils.isChatKey(pk) ? "" : ensName);
function doJoin(pubKey, username) {
popup.joinPrivateChat(pubKey, Utils.isChatKey(pubKey) ? "" : username);
popup.close();
}
@ -31,8 +31,7 @@ ModalPopup {
contactFieldAndList.pubKey = ""
contactFieldAndList.ensUsername = ""
contactFieldAndList.chatKey.forceActiveFocus(Qt.MouseFocusReason)
// Not Refactored Yet
// contactFieldAndList.existingContacts.visible = popup.store.allContacts.hasAddedContacts()
contactFieldAndList.existingContacts.visible = contactsStore.myContactsModel.count > 0
contactFieldAndList.noContactsRect.visible = !contactFieldAndList.existingContacts.visible
}
@ -45,8 +44,8 @@ ModalPopup {
contactsStore: popup.contactsStore
onUserClicked: function (isContact, pubKey, ensName) {
popup.doJoin(pubKey, ensName);
onUserClicked: function (pubKey, isAddedContact, username) {
popup.doJoin(pubKey, username);
}
}

View File

@ -55,8 +55,9 @@ Item {
contactsStore: root.contactsStore
onUserClicked: function (isContact, pubKey, ensName, address) {
chatKey.text = address
onUserClicked: function (pubKey, isContact) {
console.warning("This is not refactored yet. We need to figure out where to get the address from")
//chatKey.text = address
}
searchResultsWidth: parentWidth
chatKey.customHeight: 56

View File

@ -32,7 +32,7 @@ Item {
property bool showCheckbox: false
property bool showContactList: true
property bool showSearch: true
signal userClicked(string pubKey, bool isAddedContact)
signal userClicked(string pubKey, bool isAddedContact, string name)
property var pubKeys: ([])
property bool hideCommunityMembers: false
property bool addContactEnabled: true
@ -197,7 +197,7 @@ Item {
}
root.pubKeys = pubKeysCopy
userClicked(contact.pubKey, contact.isContact)
userClicked(contact.pubKey, contact.isContact, contact.name)
}
expanded: !searchResults.loading && pubKey === "" && !searchResults.showProfileNotFoundMessage
}
@ -215,7 +215,7 @@ Item {
if (!validate()) {
return
}
userClicked(pubKey, isAddedContact)
userClicked(pubKey, isAddedContact, username)
}
onAddToContactsButtonClicked: {
root.contactsStore.addContact(pubKey)

View File

@ -35,7 +35,7 @@ Item {
return root.pubKey != "" ? Utils.getContactDetailsAsJson(root.pubKey).isContact : false
}
signal resultClicked(string pubKey, bool isAddedContact)
signal resultClicked(string pubKey, bool isAddedContact, string username)
signal addToContactsButtonClicked(string pubKey)
function reset() {
@ -117,7 +117,7 @@ Item {
onExited: foundContact.hovered = false
onClicked: {
if (root.resultClickable) {
root.resultClicked(root.pubKey, root.isAddedContact)
root.resultClicked(root.pubKey, root.isAddedContact, root.username)
}
}
}