feat(CommunityBackup): remove backup banner after clicking on it

This commit is contained in:
Jonathan Rainville 2021-04-29 10:48:16 -04:00 committed by Iuri Matias
parent f353a29c3f
commit 1b491df9b4
3 changed files with 9 additions and 3 deletions

View File

@ -135,7 +135,7 @@ Rectangle {
Loader {
id: emptyViewAndSuggestionsLoader
active: !appSettings.hiddenCommunityWelcomeBanners.includes(chatsModel.communities.activeCommunity.id) && chatsModel.communities.activeCommunity.admin
active: chatsModel.communities.activeCommunity.admin && !appSettings.hiddenCommunityWelcomeBanners.includes(chatsModel.communities.activeCommunity.id)
width: parent.width
height: active ? item.height : 0
anchors.top: channelList.bottom
@ -146,7 +146,7 @@ Rectangle {
}
Loader {
id: backUpBannerLoader
active: chatsModel.communities.activeCommunity.admin
active: chatsModel.communities.activeCommunity.admin && !appSettings.hiddenCommunityBackUpBanners.includes(chatsModel.communities.activeCommunity.id)
width: parent.width
height: active ? item.height : 0
anchors.top: emptyViewAndSuggestionsLoader.bottom

View File

@ -53,7 +53,12 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: backUpText.bottom
anchors.topMargin: Style.current.padding
onClicked: openPopup(transferOwnershipPopup, {privateKey: chatsModel.communities.exportComumnity()})
onClicked: {
let hiddenBannerIds = appSettings.hiddenCommunityBackUpBanners
hiddenBannerIds.push(chatsModel.communities.activeCommunity.id)
appSettings.hiddenCommunityBackUpBanners = hiddenBannerIds
openPopup(transferOwnershipPopup, {privateKey: chatsModel.communities.exportComumnity()})
}
}
}

View File

@ -117,6 +117,7 @@ RowLayout {
property bool timelineEnabled: true
property var recentEmojis: []
property var hiddenCommunityWelcomeBanners: []
property var hiddenCommunityBackUpBanners: []
property real volume: 0.2
property int notificationSetting: Constants.notifyAllMessages
property bool notificationSoundsEnabled: true