fix: unbreak profile showcase
- amISectionAdmin no longer exists - profile section wallet store no longer provided the base assets model
This commit is contained in:
parent
045dfe60a0
commit
38bbd0fb53
|
@ -1,8 +1,11 @@
|
|||
import QtQuick 2.15
|
||||
|
||||
import utils 1.0
|
||||
|
||||
ShowcaseDelegate {
|
||||
title: !!showcaseObj && !!showcaseObj.name ? showcaseObj.name : ""
|
||||
secondaryTitle: !!showcaseObj && !!showcaseObj.amISectionAdmin ? qsTr("Admin") : qsTr("Member")
|
||||
secondaryTitle: !!showcaseObj && (showcaseObj.memberRole === Constants.memberRole.owner ||
|
||||
showcaseObj.memberRole === Constants.memberRole.admin) ? qsTr("Admin") : qsTr("Member")
|
||||
hasImage: !!showcaseObj && !!showcaseObj.image
|
||||
|
||||
icon.name: !!showcaseObj ? showcaseObj.name : ""
|
||||
|
|
|
@ -9,7 +9,7 @@ ProfileShowcasePanel {
|
|||
|
||||
settingsKey: "communities"
|
||||
keyRole: "id"
|
||||
roleNames: ["id", "name", "amISectionAdmin", "image", "color"]
|
||||
roleNames: ["id", "name", "memberRole", "image", "color"]
|
||||
filterFunc: (modelData) => modelData.joined && !showcaseModel.hasItem(modelData.id)
|
||||
hiddenPlaceholderBanner: qsTr("Communities here will show on your profile")
|
||||
showcasePlaceholderBanner: qsTr("Communities here will be hidden from your profile")
|
||||
|
|
|
@ -10,7 +10,7 @@ QtObject {
|
|||
|
||||
property var accountSensitiveSettings: Global.appIsReady? localAccountSensitiveSettings : null
|
||||
|
||||
property var areTestNetworksEnabled: networksModule.areTestNetworksEnabled
|
||||
readonly property bool areTestNetworksEnabled: networksModule.areTestNetworksEnabled
|
||||
property var networks: networksModule.networks
|
||||
|
||||
function toggleTestNetworksEnabled(){
|
||||
|
@ -20,7 +20,7 @@ QtObject {
|
|||
// TODO(alaibe): there should be no access to wallet section, create collectible in profile
|
||||
property var overview: walletSectionOverview
|
||||
property var flatCollectibles: Global.appIsReady ? walletSectionCollectibles.model : null
|
||||
|
||||
property var assets: walletSectionAssets.assets
|
||||
property var accounts: Global.appIsReady? accountsModule.accounts : null
|
||||
|
||||
function deleteAccount(address) {
|
||||
|
|
|
@ -84,7 +84,7 @@ Control {
|
|||
}
|
||||
sorters: [
|
||||
RoleSorter {
|
||||
roleName: "amISectionAdmin"
|
||||
roleName: "memberRole"
|
||||
sortOrder: Qt.DescendingOrder // admin first
|
||||
},
|
||||
StringSorter {
|
||||
|
@ -103,7 +103,7 @@ Control {
|
|||
subTitle: model.description
|
||||
tertiaryTitle: qsTr("%n member(s)", "", model.members.count)
|
||||
asset.name: model.image ?? model.name
|
||||
asset.isImage: asset.name.startsWith("data:image/")
|
||||
asset.isImage: asset.name.startsWith(Constants.dataImagePrefix)
|
||||
asset.isLetterIdenticon: !model.image
|
||||
asset.color: model.color
|
||||
asset.width: 40
|
||||
|
@ -112,7 +112,8 @@ Control {
|
|||
border.color: Theme.palette.baseColor2
|
||||
components: [
|
||||
StatusIcon {
|
||||
visible: model.amISectionAdmin
|
||||
visible: model.memberRole === Constants.memberRole.owner ||
|
||||
model.memberRole === Constants.memberRole.admin
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon: "crown"
|
||||
color: Theme.palette.directColor1
|
||||
|
|
Loading…
Reference in New Issue