This change enables chat/community section to work as they did before refactoring

This commit is contained in:
Sale Djenic 2021-10-28 16:08:18 +02:00 committed by Iuri Matias
parent 4c96bc70ed
commit 7a5a10af61
1 changed files with 21 additions and 23 deletions

View File

@ -213,7 +213,7 @@ Item {
} }
} }
navBarCommunityTabButtons.model: localAccountSensitiveSettings.communitiesEnabled && mainModule.sectionsModel navBarCommunityTabButtons.model: localAccountSensitiveSettings.communitiesEnabled && chatsModel.communities.joinedCommunities
navBarCommunityTabButtons.delegate: StatusNavBarTabButton { navBarCommunityTabButtons.delegate: StatusNavBarTabButton {
onClicked: { onClicked: {
appMain.changeAppSection(Constants.chat) appMain.changeAppSection(Constants.chat)
@ -224,11 +224,10 @@ Item {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
checked: chatsModel.communities.activeCommunity.active && chatsModel.communities.activeCommunity.id === model.id checked: chatsModel.communities.activeCommunity.active && chatsModel.communities.activeCommunity.id === model.id
name: model.icon.length > 0? "" : model.name name: model.name
tooltip.text: model.name tooltip.text: model.name
icon.color: model.color.length > 0? model.color : Theme.palette.baseColor1 icon.color: model.communityColor
icon.source: model.image icon.source: model.thumbnailImage
icon.name: model.icon
badge.value: model.unviewedMentionsCount + model.requestsCount badge.value: model.unviewedMentionsCount + model.requestsCount
badge.visible: badge.value > 0 || (!checked && model.unviewedMessagesCount > 0) badge.visible: badge.value > 0 || (!checked && model.unviewedMessagesCount > 0)
@ -567,24 +566,23 @@ Item {
onNotificationClicked: { onNotificationClicked: {
applicationWindow.makeStatusAppActive() applicationWindow.makeStatusAppActive()
// This is not handled yet. switch(notificationType){
// switch(notificationType){ case Constants.osNotificationType.newContactRequest:
// case Constants.osNotificationType.newContactRequest: appView.currentIndex = Utils.getAppSectionIndex(Constants.chat)
// appView.currentIndex = Utils.getAppSectionIndex(Constants.chat) appMain.openContactsPopup()
// appMain.openContactsPopup() break
// break case Constants.osNotificationType.acceptedContactRequest:
// case Constants.osNotificationType.acceptedContactRequest: appView.currentIndex = Utils.getAppSectionIndex(Constants.chat)
// appView.currentIndex = Utils.getAppSectionIndex(Constants.chat) break
// break case Constants.osNotificationType.joinCommunityRequest:
// case Constants.osNotificationType.joinCommunityRequest: case Constants.osNotificationType.acceptedIntoCommunity:
// case Constants.osNotificationType.acceptedIntoCommunity: case Constants.osNotificationType.rejectedByCommunity:
// case Constants.osNotificationType.rejectedByCommunity: appView.currentIndex = Utils.getAppSectionIndex(Constants.community)
// appView.currentIndex = Utils.getAppSectionIndex(Constants.community) break
// break case Constants.osNotificationType.newMessage:
// case Constants.osNotificationType.newMessage: appView.currentIndex = Utils.getAppSectionIndex(Constants.chat)
// appView.currentIndex = Utils.getAppSectionIndex(Constants.chat) break
// break }
// }
} }
} }