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

View File

@ -53,7 +53,12 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: backUpText.bottom anchors.top: backUpText.bottom
anchors.topMargin: Style.current.padding 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 bool timelineEnabled: true
property var recentEmojis: [] property var recentEmojis: []
property var hiddenCommunityWelcomeBanners: [] property var hiddenCommunityWelcomeBanners: []
property var hiddenCommunityBackUpBanners: []
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