fix(contact): unblock input when possible request pending

This commit is contained in:
Jonathan Rainville 2021-07-20 10:22:32 -04:00 committed by Iuri Matias
parent 5f8a6f33fa
commit 2cc819af46
2 changed files with 9 additions and 13 deletions

View File

@ -184,13 +184,10 @@ Item {
switch (chatsModel.channelView.activeChannel.chatType) {
case Constants.chatTypeOneToOne:
return (profileModel.contacts.isAdded(topBar.chatId) ?
profileModel.contacts.contactRequestReceived(topBar.chatId) ?
//% "Contact"
qsTrId("chat-is-a-contact") :
//% "Contact request pending"
qsTrId("contact-request-pending") :
//% "Not a contact"
qsTrId("chat-is-not-a-contact"))
//% "Contact"
qsTrId("chat-is-a-contact") :
//% "Not a contact"
qsTrId("chat-is-not-a-contact"))
case Constants.chatTypePublic:
//% "Public chat"
return qsTrId("public-chat")
@ -397,7 +394,7 @@ Item {
return chatsModel.channelView.activeChannel.isMember
}
if (chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne) {
return isContact && contactRequestReceived
return isContact
}
const community = chatsModel.communities.activeCommunity
return !community.active ||

View File

@ -4,7 +4,7 @@ import "../../../../../shared"
import "../../../../../shared/status"
Item {
visible: chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne && (!isContact || !contactRequestReceived)
visible: chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne && (!isContact /*|| !contactRequestReceived*/)
width: parent.width
height: childrenRect.height
@ -18,10 +18,9 @@ Item {
StyledText {
id: contactText1
//% "You need to be mutual contacts with this person for them to receive your messages"
text: !isContact ? qsTrId("you-need-to-be-mutual-contacts-with-this-person-for-them-to-receive-your-messages") :
//% "Waiting for %1 to accept your request"
qsTrId("waiting-for--1-to-accept-your-request").arg(Utils.removeStatusEns(chatsModel.channelView.activeChannel.name))
text: qsTr("You need to be mutual contacts with this person for them to receive your messages")
// text: !isContact ? qsTr("You need to be mutual contacts with this person for them to receive your messages") :
// qsTr("Waiting for %1 to accept your request").arg(Utils.removeStatusEns(chatsModel.channelView.activeChannel.name))
anchors.top: waveImg.bottom
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.WordWrap