Improvement: isLoading Opacity Change for UiObject

This commit is contained in:
Smidy13 committed 2021-10-27 11:24:17 +13:00
1 parent def769b7c6
commit 67355c875d
2 files changed
+16 -3

No files matched your search

@@ -21,6 +21,7 @@ function newUiObject() {
uiObjectTitle: undefined,
uiObjectMessage: undefined,
circularProgressBar: undefined,
isLoading: undefined,
isRunning: undefined,
isPlaying: undefined,
shortcutKey: undefined,
@@ -2421,10 +2422,13 @@ function newUiObject() {
if (icon !== undefined) {
if (icon.canDrawIcon === true) {
// If this is a User Profile and blockchainTokens is still being loaded then display at half opacity
if(thisObject.payload.node.type === "User Profile" && thisObject.payload.blockchainTokens === undefined) {
// If this UiObject is being loaded then display at half opacity
if(thisObject.payload.isLoading === true) {
browserCanvasContext.globalAlpha = 0.5
} else {
browserCanvasContext.globalAlpha = 1
}
let additionalImageSize = 0
if (isRunningAtBackend === true || isReadyToReferenceAttach === true || isReadyToChainAttach === true) { additionalImageSize = 20 }
let totalImageSize = additionalImageSize + thisObject.payload.floatingObject.currentImageSize
@@ -2459,7 +2463,6 @@ function newUiObject() {
totalImageSize,
totalImageSize)
}
browserCanvasContext.globalAlpha = 1
}
if (executingIcon !== undefined) {
@@ -55,6 +55,13 @@ function newGovernanceUserProfileSpace() {
}
}
let userProfiles = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('User Profile')
// Initialise the isLoading parameter for each User Profile
for (let i = 0; i < userProfiles.length; i++) {
let userProfile = userProfiles[i]
userProfile.payload.isLoading = true
}
/*
let pools = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('Pools')
let assets = UI.projects.foundations.spaces.designSpace.workspace.getHierarchyHeadsByNodeType('Assets')
@@ -374,11 +381,13 @@ function newGovernanceUserProfileSpace() {
if (userProfile.payload === undefined) { continue }
if (userProfile.payload.bloackchainBalancesLoading === true) {
userProfile.payload.isLoading = true
return
}
if (userProfile.payload.blockchainTokens === undefined) {
userProfile.payload.bloackchainBalancesLoading = true
userProfile.payload.isLoading = true
UI.projects.foundations.spaces.cockpitSpace.setStatus('Loading blockchain balances for User Profile # ' + (i + 1) + ' / ' + userProfiles.length, 1500, UI.projects.foundations.spaces.cockpitSpace.statusTypes.ALL_GOOD)
getBlockchainAccount(userProfile)
@@ -461,6 +470,7 @@ function newGovernanceUserProfileSpace() {
return response.json();
}).then(function (data) {
userProfile.payload.bloackchainBalancesLoading = false
userProfile.payload.isLoading = false
if (data.result === "Max rate limit reached, please use API Key for higher rate limit") {
userProfile.payload.blockchainTokens = undefined
} else {