fix: warning while switching between accounts

The is image flag and source was not in sync due to sequential change
of source and isImage. This was causing the following warning:
`Warning: qrc:/StatusQ/Components/StatusRoundedImage.qml:27:5: QML StatusImage: Cannot open: qrc:/StatusQ/Components/help
This commit is contained in:
Stefan 2024-04-11 18:26:02 +03:00 committed by Stefan Dunca
parent 7cb59576a1
commit 228622359d
2 changed files with 18 additions and 3 deletions

View File

@ -51,7 +51,7 @@ Loader {
id: statusRoundImage id: statusRoundImage
width: parent.width width: parent.width
height: parent.height height: parent.height
image.source: root.asset.name image.source: root.asset.isImage ? root.asset.name : ""
showLoadingIndicator: true showLoadingIndicator: true
border.width: root.asset.imgIsIdenticon ? 1 : 0 border.width: root.asset.imgIsIdenticon ? 1 : 0
border.color: Theme.palette.directColor7 border.color: Theme.palette.directColor7

View File

@ -54,8 +54,23 @@ Control {
asset.width: 16 asset.width: 16
asset.height: 16 asset.height: 16
visible: root.useLongTextDescription && !!asset.source visible: root.useLongTextDescription && !!asset.source
asset.name: !!root.communityImage ? root.communityImage : "help"
asset.isImage: !!root.communityImage Component.onCompleted: {
updateCommunityImage()
}
Connections {
target: root
function onCommunityImageChanged() {
identicon.updateCommunityImage()
}
}
function updateCommunityImage() {
// Ensure we keep the flag in sync with the type of asset otherwise we generate warnings
identicon.asset.name = ""
identicon.asset.isImage = !!root.communityImage
identicon.asset.name = !!root.communityImage ? root.communityImage : "help"
}
} }
RowLayout { RowLayout {