chore(ProfileShowcase): Cherry-pick profile showcase loading state
https://github.com/status-im/status-desktop/pull/14260
This commit is contained in:
parent
9cad3db60f
commit
32d70c1715
|
@ -338,9 +338,9 @@ method requestProfileShowcase*(self: Module, publicKey: string) =
|
|||
if self.showcasePublicKey != publicKey:
|
||||
self.view.clearShowcaseModels()
|
||||
self.showcasePublicKey = publicKey
|
||||
|
||||
self.showcaseForAContactLoading = true
|
||||
self.view.emitShowcaseForAContactLoadingChangedSignal()
|
||||
|
||||
self.controller.requestProfileShowcaseForContact(publicKey, false)
|
||||
|
||||
method onProfileShowcaseUpdated(self: Module, publicKey: string) =
|
||||
|
|
|
@ -278,9 +278,9 @@ QtObject:
|
|||
proc showcaseForAContactLoadingChanged*(self: View) {.signal.}
|
||||
proc emitShowcaseForAContactLoadingChangedSignal*(self: View) =
|
||||
self.showcaseForAContactLoadingChanged()
|
||||
proc isShowcaseForAContactLoading*(self: View): bool {.signal.} =
|
||||
proc isShowcaseForAContactLoading*(self: View): bool {.slot.} =
|
||||
return self.delegate.isShowcaseForAContactLoading()
|
||||
QtProperty[QVariant] showcaseForAContactLoading:
|
||||
QtProperty[bool] showcaseForAContactLoading:
|
||||
read = isShowcaseForAContactLoading
|
||||
notify = showcaseForAContactLoadingChanged
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ QObject {
|
|||
|
||||
//helpers
|
||||
property var isAddressSaved: (address) => false
|
||||
property bool isShowcaseLoading: false
|
||||
|
||||
// Collectibles input models
|
||||
property alias collectiblesSourceModel: collectiblesSFPM.sourceModel
|
||||
|
@ -65,6 +66,10 @@ QObject {
|
|||
function getShowcaseVisibility() {
|
||||
return Constants.ShowcaseVisibility.Everyone
|
||||
}
|
||||
},
|
||||
FastExpressionRole {
|
||||
name: "isShowcaseLoading"
|
||||
expression: root.isShowcaseLoading
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -57,6 +57,10 @@ QObject {
|
|||
name: "membersCount"
|
||||
expression: model.members.count
|
||||
expectedRoles: ["members"]
|
||||
},
|
||||
FastExpressionRole {
|
||||
name: "isShowcaseLoading"
|
||||
expression: false
|
||||
}
|
||||
]
|
||||
filters: ValueFilter {
|
||||
|
|
|
@ -25,6 +25,8 @@ QtObject {
|
|||
readonly property var showcaseContactAssetsModel: contactsModule.showcaseContactAssetsModel
|
||||
readonly property var showcaseContactSocialLinksModel: contactsModule.showcaseContactSocialLinksModel
|
||||
|
||||
readonly property bool isShowcaseForAContactLoading: contactsModule.showcaseForAContactLoading
|
||||
|
||||
// Support models for showcase for a contact with showcasePublicKey
|
||||
readonly property var showcaseCollectiblesModel: contactsModule.showcaseCollectiblesModel
|
||||
|
||||
|
|
|
@ -201,6 +201,7 @@ QtObject {
|
|||
isAddressSaved: (address) => {
|
||||
return false
|
||||
}
|
||||
isShowcaseLoading: root.contactsStore.isShowcaseForAContactLoading
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ Item {
|
|||
implicitHeight: GridView.view.cellHeight - Style.current.padding
|
||||
titleFontSize: 15
|
||||
communityId: model.id ?? ""
|
||||
loaded: !!model.id
|
||||
loaded: !!model.id && !model.isShowcaseLoading
|
||||
asset.source: model.image ?? ""
|
||||
asset.isImage: !!model.image
|
||||
asset.width: 32
|
||||
|
|
Loading…
Reference in New Issue