mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
Merge pull request #15616 from zfox23/SUI/errorStatesAvatar
Define/show some error states in the Avatar app
This commit is contained in:
commit
8a2132ca9b
1 changed files with 25 additions and 4 deletions
|
@ -58,7 +58,8 @@ Rectangle {
|
|||
if (isLoggedIn) {
|
||||
Commerce.getWalletStatus();
|
||||
} else {
|
||||
// Show some error to the user
|
||||
errorText.text = "There was a problem while retrieving your inventory. " +
|
||||
"Please try closing and re-opening the Avatar app.\n\nLogin status result: " + isLoggedIn;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -66,11 +67,19 @@ Rectangle {
|
|||
if (walletStatus === 5) {
|
||||
getInventory();
|
||||
} else {
|
||||
// Show some error to the user
|
||||
errorText.text = "There was a problem while retrieving your inventory. " +
|
||||
"Please try closing and re-opening the Avatar app.\n\nWallet status result: " + walletStatus;
|
||||
}
|
||||
}
|
||||
|
||||
onInventoryResult: {
|
||||
if (result.status !== "success") {
|
||||
errorText.text = "There was a problem while retrieving your inventory. " +
|
||||
"Please try closing and re-opening the Avatar app.\n\nInventory status: " + result.status + "\nMessage: " + result.message;
|
||||
} else if (result.data && result.data.assets && result.data.assets.length === 0) {
|
||||
errorText.text = "You have not created any avatars yet! Create an avatar with the Avatar Creator, then close and re-open the Avatar App."
|
||||
}
|
||||
|
||||
avatarAppInventoryModel.handlePage(result.status !== "success" && result.message, result);
|
||||
root.updatePreviewUrl();
|
||||
}
|
||||
|
@ -172,7 +181,7 @@ Rectangle {
|
|||
anchors.bottom: parent.bottom
|
||||
|
||||
AnimatedImage {
|
||||
visible: !inventoryContentsList.visible
|
||||
visible: !inventoryContentsList.visible && !errorText.visible
|
||||
anchors.centerIn: parent
|
||||
width: 72
|
||||
height: width
|
||||
|
@ -181,7 +190,7 @@ Rectangle {
|
|||
|
||||
ListView {
|
||||
id: inventoryContentsList
|
||||
visible: avatarAppInventoryModel.count !== 0
|
||||
visible: avatarAppInventoryModel.count !== 0 && !errorText.visible
|
||||
interactive: contentItem.height > height
|
||||
clip: true
|
||||
model: avatarAppInventoryModel
|
||||
|
@ -196,6 +205,18 @@ Rectangle {
|
|||
standaloneIncompatible: model.standalone_incompatible
|
||||
}
|
||||
}
|
||||
|
||||
HifiStylesUit.GraphikRegular {
|
||||
id: errorText
|
||||
text: ""
|
||||
visible: text !== ""
|
||||
anchors.fill: parent
|
||||
size: 22
|
||||
color: simplifiedUI.colors.text.white
|
||||
wrapMode: Text.Wrap
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue