Browse Source

Fix syncstatus

master
AlphaX-Projects 10 months ago
parent
commit
89735ac9b0
  1. 38
      core/src/components/friends-view/core-sync-status.js

38
core/src/components/friends-view/core-sync-status.js

@ -93,6 +93,7 @@ class CoreSyncStatus extends connect(store)(LitElement) {
}, 60000) }, 60000)
} }
async getCoreInfos() { async getCoreInfos() {
const corInfo = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node] const corInfo = store.getState().app.nodeConfig.knownNodes[store.getState().app.nodeConfig.node]
const coreInfoUrl = corInfo.protocol + '://' + corInfo.domain + ':' + corInfo.port const coreInfoUrl = corInfo.protocol + '://' + corInfo.domain + ':' + corInfo.port
@ -101,12 +102,11 @@ class CoreSyncStatus extends connect(store)(LitElement) {
return response.json() return response.json()
}).then(data => { }).then(data => {
this.coreInfos = data this.coreInfos = data
}).catch(err => {
}) })
} }
renderSyncStatusIcon() { renderSyncStatusIcon() {
if (this.nodeStatus.isSynchronizing === true) { if (this.nodeStatus.isSynchronizing === true && this.nodeStatus.syncPercent === 99) {
return html` return html`
<div class="tooltip" style="display: inline;"> <div class="tooltip" style="display: inline;">
<span><img src="/img/syncing.png" style="height: 24px; width: 24px; padding-top: 4px;"></span> <span><img src="/img/syncing.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
@ -120,7 +120,21 @@ class CoreSyncStatus extends connect(store)(LitElement) {
</div> </div>
</div> </div>
` `
} 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`
<div class="tooltip" style="display: inline;">
<span><img src="/img/synced.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
<div class="bottom">
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("walletprofile.wp4")} ${translate("walletprofile.wp2")}</h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
`
} else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === false && this.nodeStatus.syncPercent === 100) {
return html` return html`
<div class="tooltip" style="display: inline;"> <div class="tooltip" style="display: inline;">
<span><img src="/img/synced.png" style="height: 24px; width: 24px; padding-top: 4px;"></span> <span><img src="/img/synced.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
@ -134,7 +148,21 @@ class CoreSyncStatus extends connect(store)(LitElement) {
</div> </div>
</div> </div>
` `
} 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`
<div class="tooltip" style="display: inline;">
<span><img src="/img/synced_minting.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
<div class="bottom">
<h3>${translate("walletprofile.wp3")}</h3>
<h4 class="lineHeight">${translate("appinfo.coreversion")}: <span style="color: #03a9f4">${this.coreInfos.buildVersion ? (this.coreInfos.buildVersion).substring(0,12) : ''}</span></h4>
<h4 class="lineHeight">${translate("walletprofile.wp4")} <span style="color: #03a9f4">( ${translate("walletprofile.wp1")} )</span></h4>
<h4 class="lineHeight">${translate("appinfo.blockheight")}: <span style="color: #03a9f4">${this.nodeStatus.height ? this.nodeStatus.height : ''}</span></h4>
<h4 class="lineHeight">${translate("appinfo.peers")}: <span style="color: #03a9f4">${this.nodeStatus.numberOfConnections ? this.nodeStatus.numberOfConnections : ''}</span></h4>
<i></i>
</div>
</div>
`
} else if (this.nodeStatus.isSynchronizing === false && this.nodeStatus.isMintingPossible === true && this.nodeStatus.syncPercent === 100) {
return html` return html`
<div class="tooltip" style="display: inline;"> <div class="tooltip" style="display: inline;">
<span><img src="/img/synced_minting.png" style="height: 24px; width: 24px; padding-top: 4px;"></span> <span><img src="/img/synced_minting.png" style="height: 24px; width: 24px; padding-top: 4px;"></span>
@ -157,4 +185,4 @@ class CoreSyncStatus extends connect(store)(LitElement) {
} }
customElements.define('core-sync-status', CoreSyncStatus) customElements.define('core-sync-status', CoreSyncStatus)
Loading…
Cancel
Save