mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Show error states in Avatar app (BUGZ-310)
This commit is contained in:
parent
ddb299a387
commit
3ed47b4f23
1 changed files with 23 additions and 4 deletions
|
@ -58,7 +58,8 @@ Rectangle {
|
||||||
if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
Commerce.getWalletStatus();
|
Commerce.getWalletStatus();
|
||||||
} else {
|
} 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,17 @@ Rectangle {
|
||||||
if (walletStatus === 5) {
|
if (walletStatus === 5) {
|
||||||
getInventory();
|
getInventory();
|
||||||
} else {
|
} 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: {
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
avatarAppInventoryModel.handlePage(result.status !== "success" && result.message, result);
|
avatarAppInventoryModel.handlePage(result.status !== "success" && result.message, result);
|
||||||
root.updatePreviewUrl();
|
root.updatePreviewUrl();
|
||||||
}
|
}
|
||||||
|
@ -172,7 +179,7 @@ Rectangle {
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
visible: !inventoryContentsList.visible
|
visible: !inventoryContentsList.visible && !errorText.visible
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 72
|
width: 72
|
||||||
height: width
|
height: width
|
||||||
|
@ -181,7 +188,7 @@ Rectangle {
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: inventoryContentsList
|
id: inventoryContentsList
|
||||||
visible: avatarAppInventoryModel.count !== 0
|
visible: avatarAppInventoryModel.count !== 0 && !errorText.visible
|
||||||
interactive: contentItem.height > height
|
interactive: contentItem.height > height
|
||||||
clip: true
|
clip: true
|
||||||
model: avatarAppInventoryModel
|
model: avatarAppInventoryModel
|
||||||
|
@ -196,6 +203,18 @@ Rectangle {
|
||||||
standaloneIncompatible: model.standalone_incompatible
|
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