fix(community): fix qml errors when creating a community

Fixes #4440
This commit is contained in:
Jonathan Rainville 2022-01-17 13:49:30 -05:00 committed by Sale Djenic
parent d073dd215a
commit 6f8f9b6f76
2 changed files with 15 additions and 4 deletions

View File

@ -77,9 +77,16 @@ StatusAppThreePanelLayout {
}
showRightPanel: {
// Check if user list is available as an option for particular chat content module.
let usersListAvailable = root.rootStore.currentChatContentModule().chatDetails.isUsersListAvailable
return localAccountSensitiveSettings.showOnlineUsers && usersListAvailable && localAccountSensitiveSettings.expandUsersList
if (!localAccountSensitiveSettings.showOnlineUsers || !localAccountSensitiveSettings.expandUsersList) {
return false
}
let chatContentModule = root.rootStore.currentChatContentModule()
if (!chatContentModule) {
// New communities have no chats, so no chatContentModule
return false
}
// Check if user list is available as an option for particular chat content module
return chatContentModule.chatDetails.isUsersListAvailable
}
rightPanel: localAccountSensitiveSettings.communitiesEnabled && root.rootStore.chatCommunitySectionModule.isCommunity()?
@ -92,6 +99,10 @@ StatusAppThreePanelLayout {
messageContextMenu: quickActionMessageOptionsMenu
usersModule: {
let chatContentModule = root.rootStore.currentChatContentModule()
if (!chatContentModule || !chatContentModule.usersModule) {
// New communities have no chats, so no chatContentModule
return {}
}
return chatContentModule.usersModule
}
}

View File

@ -343,7 +343,7 @@ Item {
width: parent.width
height: {
// I dont know why, the binding doesn't work well if this isn't here
item.height
item && item.height
return this.active ? item.height : 0
}
anchors.top: communityChatListAndCategories.bottom