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

View File

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