fix: ensure InvitationBubbleView loading state for missing community
fixes: #12481
This commit is contained in:
parent
c6c1c0e873
commit
acdd59faed
|
@ -15,24 +15,22 @@ import shared.popups 1.0
|
||||||
Control {
|
Control {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
implicitWidth: d.invitedCommunity || loading ? 270 /*by design*/ : 0
|
implicitWidth: d.invitedCommunity || d.loading ? 270 /*by design*/ : 0
|
||||||
padding: 1
|
padding: 1
|
||||||
|
|
||||||
property var store
|
property var store
|
||||||
property string communityId
|
property string communityId
|
||||||
property bool loading: false
|
|
||||||
property var communityData
|
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
|
|
||||||
property var invitedCommunity
|
property var invitedCommunity
|
||||||
|
|
||||||
readonly property string communityName: !!d.invitedCommunity ? d.invitedCommunity.name : (communityData ? communityData.displayName : "")
|
readonly property string communityName: !!d.invitedCommunity ? d.invitedCommunity.name : ""
|
||||||
readonly property string communityDescription: !!d.invitedCommunity ? d.invitedCommunity.description : (communityData ? communityData.description : "")
|
readonly property string communityDescription: !!d.invitedCommunity ? d.invitedCommunity.description : ""
|
||||||
readonly property string communityImage: !!d.invitedCommunity ? d.invitedCommunity.image : ""
|
readonly property string communityImage: !!d.invitedCommunity ? d.invitedCommunity.image : ""
|
||||||
readonly property string communityColor: !!d.invitedCommunity ? d.invitedCommunity.color : (communityData ? communityData.color : "")
|
readonly property string communityColor: !!d.invitedCommunity ? d.invitedCommunity.color : ""
|
||||||
readonly property int communityNbMembers: !!d.invitedCommunity ? d.invitedCommunity.nbMembers : (communityData ? communityData.membersCount : 0)
|
readonly property int communityNbMembers: !!d.invitedCommunity ? d.invitedCommunity.nbMembers : 0
|
||||||
readonly property bool communityVerified: false //!!d.invitedCommunity ? d.invitedCommunity.verified : false TODO: add this to the community object if we should support verified communities
|
readonly property bool communityVerified: false //!!d.invitedCommunity ? d.invitedCommunity.verified : false TODO: add this to the community object if we should support verified communities
|
||||||
readonly property bool communityJoined: !!d.invitedCommunity ? d.invitedCommunity.joined : false
|
readonly property bool communityJoined: !!d.invitedCommunity ? d.invitedCommunity.joined : false
|
||||||
readonly property bool communitySpectated: !!d.invitedCommunity ? d.invitedCommunity.spectated : false
|
readonly property bool communitySpectated: !!d.invitedCommunity ? d.invitedCommunity.spectated : false
|
||||||
|
@ -40,6 +38,8 @@ Control {
|
||||||
readonly property int margin: 12
|
readonly property int margin: 12
|
||||||
readonly property int radius: Style.current.padding
|
readonly property int radius: Style.current.padding
|
||||||
|
|
||||||
|
readonly property bool loading: !d.invitedCommunity
|
||||||
|
|
||||||
function getCommunity() {
|
function getCommunity() {
|
||||||
try {
|
try {
|
||||||
const communityJson = root.store.getSectionByIdJson(communityId)
|
const communityJson = root.store.getSectionByIdJson(communityId)
|
||||||
|
@ -188,7 +188,7 @@ Control {
|
||||||
height: (parent.height+d.radius)
|
height: (parent.height+d.radius)
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: -d.radius
|
anchors.topMargin: -d.radius
|
||||||
loading: root.loading
|
loading: d.loading
|
||||||
radius: d.radius - 1 // We do -1, otherwise there's a gap between border and button
|
radius: d.radius - 1 // We do -1, otherwise there's a gap between border and button
|
||||||
contentItem: Item {
|
contentItem: Item {
|
||||||
StatusBaseText {
|
StatusBaseText {
|
||||||
|
|
Loading…
Reference in New Issue