From 8579932b12fdc3ea152b309fc3e05e96f138909e Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 17 Nov 2020 12:06:25 +0100 Subject: [PATCH] Bug fixed with saving workspace --- .../Projects/Ethereum/Schemas/AppSchema.json | 3 +++ .../Ethereum/Spaces/Blockchain-Space/Blockchain.js | 13 +++++++++---- .../Superalgos/Spaces/Cockpit-Space/CockpitSpace.js | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Integrations/Projects/Ethereum/Schemas/AppSchema.json b/Integrations/Projects/Ethereum/Schemas/AppSchema.json index e4a519c3b..67d6a4fd1 100644 --- a/Integrations/Projects/Ethereum/Schemas/AppSchema.json +++ b/Integrations/Projects/Ethereum/Schemas/AppSchema.json @@ -600,6 +600,9 @@ "actionFunction": "payload.executeAction" } ], + "referenceAttachesTo": { + "compatibleTypes": "->Network Node->" + }, "editors": { "config": true }, diff --git a/Integrations/Projects/Ethereum/Spaces/Blockchain-Space/Blockchain.js b/Integrations/Projects/Ethereum/Spaces/Blockchain-Space/Blockchain.js index 49ccb38f9..5b8bae5d8 100644 --- a/Integrations/Projects/Ethereum/Spaces/Blockchain-Space/Blockchain.js +++ b/Integrations/Projects/Ethereum/Spaces/Blockchain-Space/Blockchain.js @@ -110,10 +110,17 @@ function newEthereumBlockchainSpace() { networkClient.payload.uiObject.resetErrorMessage() - if (status.isSyncing === false) { + if (status.isSyncing === false && status.chainId === 0) { networkClient.payload.uiObject.setStatus('Client is looking for peers...', ANNIMATION_CYCLES_TO_LAST) return } + + if (status.chainId > 0) { + let networkName = UI.projects.ethereum.globals.chainIds.chainNameById(status.chainId) + networkClient.payload.uiObject.setStatus('Connected to ' + networkName + ' via http. ', ANNIMATION_CYCLES_TO_LAST) + return + } + /* If it is not syncing, then we have the current block and the highets block too */ let percentage = (status.isSyncing.currentBlock * 100 / status.isSyncing.highestBlock).toFixed(4) let extraStatus = '' @@ -134,9 +141,7 @@ function newEthereumBlockchainSpace() { if (status.isSyncing.currentBlock !== status.isSyncing.highestBlock) { networkClient.payload.uiObject.setStatus('Connected via http. Client is Syncing... ' + extraStatus, ANNIMATION_CYCLES_TO_LAST) - } else { - networkClient.payload.uiObject.setStatus('Connected to ' + client.networkName + ' via http. ', ANNIMATION_CYCLES_TO_LAST) - } + } function splitLargeNumber(number) { let label = number.toString() diff --git a/Integrations/Projects/Superalgos/Spaces/Cockpit-Space/CockpitSpace.js b/Integrations/Projects/Superalgos/Spaces/Cockpit-Space/CockpitSpace.js index 293ebc942..9068fd866 100644 --- a/Integrations/Projects/Superalgos/Spaces/Cockpit-Space/CockpitSpace.js +++ b/Integrations/Projects/Superalgos/Spaces/Cockpit-Space/CockpitSpace.js @@ -266,7 +266,7 @@ function newSuperalgosCockpitSpace() { x: thisObject.container.frame.width / 2, y: thisObject.container.frame.height / 2 + 5 } - UI.projects.superalgos.utilities.drawPrint.printLabel(statusText, undefined, position.x, undefined, position.y, 1, 15, textColor, 'Center', thisObject.container) + UI.projects.superalgos.utilities.drawPrint.printLabel(statusText, undefined, undefined, position.x, position.y, 1, 15, textColor, 'Center', thisObject.container) } if (UI.projects.superalgos.spaces.designSpace !== undefined) {