fix(@desktop/communities): mute/unmute communities

fixes #2880
This commit is contained in:
Anthony Laibe 2021-07-20 10:16:21 +02:00 committed by Iuri Matias
parent 5e8e897acc
commit 076a5bc5b7
2 changed files with 10 additions and 1 deletions

View File

@ -471,6 +471,15 @@ QtObject:
chat.muted = true
return chat
proc setCommunityMuted*(self: CommunitiesView, communityId: string, muted: bool) {.slot.} =
self.status.chat.setCommunityMuted(communityId, muted)
if (communityId == self.activeCommunity.communityItem.id):
self.activeCommunity.setMuted(muted)
var community = self.joinedCommunityList.getCommunityById(communityId)
community.muted = muted
self.joinedCommunityList.replaceCommunity(community)
proc markNotificationsAsRead*(self: CommunitiesView, markAsReadProps: MarkAsReadNotificationProperties) =
if(markAsReadProps.communityId.len == 0 and markAsReadProps.channelId.len == 0):
# Remove all notifications from all communities and their channels for set types.

View File

@ -98,7 +98,7 @@ Column {
components: [
StatusSwitch {
checked: !root.community.muted
onClicked: root.notificationsButtonClicked(checked)
onClicked: root.notificationsButtonClicked(!checked)
}
]
}