fix(Communities): ensure app remembers hidden community intro banners

Fixes #1960
This commit is contained in:
Pascal Precht 2021-03-11 13:49:29 +01:00 committed by Iuri Matias
parent 7bb8a968c9
commit eefd56dd28
3 changed files with 5 additions and 2 deletions

View File

@ -128,7 +128,7 @@ Item {
CommunityWelcomeBanner {
id: emptyViewAndSuggestions
visible: chatsModel.communities.activeCommunity.admin
visible: !appSettings.hiddenCommunityWelcomeBanners.includes(chatsModel.communities.activeCommunity.id) && chatsModel.communities.activeCommunity.admin
width: parent.width
anchors.top: channelList.bottom
anchors.topMargin: Style.current.padding

View File

@ -46,7 +46,9 @@ Rectangle {
icon.width: 20
iconColor: Style.current.darkGrey
onClicked: {
// TODO make this saved in the settings
let hiddenBannerIds = appSettings.hiddenCommunityWelcomeBanners
hiddenBannerIds.push(chatsModel.communities.activeCommunity.id)
appSettings.hiddenCommunityWelcomeBanners = hiddenBannerIds
root.visible = false
}
}

View File

@ -91,6 +91,7 @@ RowLayout {
property bool timelineEnabled: true
property string locale: "en"
property var recentEmojis: []
property var hiddenCommunityWelcomeBanners: []
property real volume: 0.2
property int notificationSetting: Constants.notifyAllMessages
property bool notificationSoundsEnabled: true