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 { CommunityWelcomeBanner {
id: emptyViewAndSuggestions id: emptyViewAndSuggestions
visible: chatsModel.communities.activeCommunity.admin visible: !appSettings.hiddenCommunityWelcomeBanners.includes(chatsModel.communities.activeCommunity.id) && chatsModel.communities.activeCommunity.admin
width: parent.width width: parent.width
anchors.top: channelList.bottom anchors.top: channelList.bottom
anchors.topMargin: Style.current.padding anchors.topMargin: Style.current.padding

View File

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

View File

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