From 89735ac9b060559081d294d9535df7801f8e805d Mon Sep 17 00:00:00 2001 From: AlphaX-Projects <77661270+AlphaX-Projects@users.noreply.github.com> Date: Sun, 19 Nov 2023 17:18:12 +0100 Subject: [PATCH] Fix syncstatus --- .../friends-view/core-sync-status.js | 38 ++++++++++++++++--- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/core/src/components/friends-view/core-sync-status.js b/core/src/components/friends-view/core-sync-status.js index 7fe7d3df..534f3a9c 100644 --- a/core/src/components/friends-view/core-sync-status.js +++ b/core/src/components/friends-view/core-sync-status.js @@ -93,6 +93,7 @@ class CoreSyncStatus extends connect(store)(LitElement) { }, 60000) } + async getCoreInfos() { const corInfo = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node] const coreInfoUrl = corInfo.protocol + '://' + corInfo.domain + ':' + corInfo.port @@ -101,12 +102,11 @@ class CoreSyncStatus extends connect(store)(LitElement) { return response.json() }).then(data => { this.coreInfos = data - }).catch(err => { }) } renderSyncStatusIcon() { - if (this.nodeStatus.isSynchronizing === true) { + if (this.nodeStatus.isSynchronizing === true && this.nodeStatus.syncPercent === 99) { return html`
@@ -120,7 +120,21 @@ class CoreSyncStatus extends connect(store)(LitElement) {
` - } else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === false) { + } else if (this.nodeStatus.isSynchronizing === true && this.nodeStatus.isMintingPossible === false && this.nodeStatus.syncPercent === 100) { + return html` +
+ +
+

${translate("walletprofile.wp3")}

+

${translate("appinfo.coreversion")}: ${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}

+

${translate("walletprofile.wp4")} ${translate("walletprofile.wp2")}

+

${translate("appinfo.blockheight")}: ${this.nodeStatus.height ? this.nodeStatus.height : ''}

+

${translate("appinfo.peers")}: ${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}

+ +
+
+ ` + } else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === false && this.nodeStatus.syncPercent === 100) { return html`
@@ -134,7 +148,21 @@ class CoreSyncStatus extends connect(store)(LitElement) {
` - } else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === true) { + } else if (this.nodeStatus.isSynchronizing === true && this.nodeStatus.isMintingPossible === true && this.nodeStatus.syncPercent === 100) { + return html` +
+ +
+

${translate("walletprofile.wp3")}

+

${translate("appinfo.coreversion")}: ${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}

+

${translate("walletprofile.wp4")} ( ${translate("walletprofile.wp1")} )

+

${translate("appinfo.blockheight")}: ${this.nodeStatus.height ? this.nodeStatus.height : ''}

+

${translate("appinfo.peers")}: ${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}

+ +
+
+ ` + } else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === true && this.nodeStatus.syncPercent === 100) { return html`
@@ -157,4 +185,4 @@ class CoreSyncStatus extends connect(store)(LitElement) { } -customElements.define('core-sync-status', CoreSyncStatus) +customElements.define('core-sync-status', CoreSyncStatus) \ No newline at end of file