fix: input box disappearing on communities

Fixes #2155
This commit is contained in:
Jonathan Rainville 2021-03-31 11:39:42 -04:00 committed by Iuri Matias
parent 303e6e9893
commit 8b3ce83d00
2 changed files with 8 additions and 6 deletions

View File

@ -54,6 +54,8 @@ QtObject:
var found = false
for chat in community.chats:
if (chat.id == newChat.id):
# canPost is not available in the newChat so we need to check what we had before
newChat.canPost = community.chats[i].canPost
community.chats[i] = newChat
found = true
i = i + 1

View File

@ -286,13 +286,13 @@ StackLayout {
id: chatInput
visible: {
const community = chatsModel.communities.activeCommunity
if (chatsModel.activeChannel.chatType !== Constants.chatTypePrivateGroupChat &&
(!community.active ||
community.access === Constants.communityChatPublicAccess ||
community.admin || chatsModel.activeChannel.canPost)) {
return true
if (chatsModel.activeChannel.chatType === Constants.chatTypePrivateGroupChat) {
return chatsModel.activeChannel.isMember
}
return chatsModel.activeChannel.isMember
return !community.active ||
community.access === Constants.communityChatPublicAccess ||
community.admin ||
chatsModel.activeChannel.canPost
}
enabled: !isBlocked
chatInputPlaceholder: isBlocked ?