fix(@desktop/chat): Hide add contact button on private chat

fixes #2595
This commit is contained in:
Anthony Laibe 2021-07-13 11:57:11 +02:00 committed by Iuri Matias
parent 869ae63518
commit 66a0611d91
3 changed files with 5 additions and 2 deletions

View File

@ -29,6 +29,7 @@ ModalPopup {
id: contactFieldAndList
anchors.top: parent.top
anchors.bottom: parent.bottom
addContactEnabled: false
onUserClicked: function (isContact, pubKey, ensName) {
chatsModel.channelView.joinPrivateChat(pubKey, Utils.isChatKey(pubKey) ? "" : ensName);
popup.close();

View File

@ -19,6 +19,7 @@ Item {
signal userClicked(bool isContact, string pubKey, string ensName, string address)
property var pubKeys: ([])
property bool hideCommunityMembers: false
property bool addContactEnabled: true
id: root
width: parent.width
@ -175,7 +176,7 @@ Item {
hasExistingContacts: existingContacts.visible
loading: false
width: searchResultsWidth > 0 ? searchResultsWidth : parent.width
addContactEnabled: root.addContactEnabled
onResultClicked: {
if (!validate()) {
return

View File

@ -19,6 +19,7 @@ Item {
property string pubKey: ""
property string address: ""
property bool resultClickable: true
property bool addContactEnabled: true
property bool isAddedContact: pubKey != "" ? chatsModel.messageView.isAddedContact(pubKey) : false
@ -120,7 +121,7 @@ Item {
anchors.right: parent.right
anchors.rightMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter
visible: !isAddedContact && !checkIcon.visible
visible: addContactEnabled && !isAddedContact && !checkIcon.visible
MouseArea {
anchors.fill: parent
hoverEnabled: true