Commit 8ade33b4 authored by dev0tion's avatar dev0tion

Temp fix for divide by 0

parent dade5002
......@@ -37,17 +37,22 @@ export class StatusBarComponent implements OnInit {
.subscribe(
response => {
if (response.status >= 200 && response.status < 400) {
let generalWalletInfoResponse = response.json();
this.lastBlockSyncedHeight = generalWalletInfoResponse.lastBlockSyncedHeight;
this.chainTip = generalWalletInfoResponse.chainTip;
this.connectedNodes = generalWalletInfoResponse.connectedNodes;
this.percentSyncedNumber = ((this.lastBlockSyncedHeight / this.chainTip) * 100);
let generalWalletInfoResponse = response.json();
this.lastBlockSyncedHeight = generalWalletInfoResponse.lastBlockSyncedHeight;
this.chainTip = generalWalletInfoResponse.chainTip;
this.connectedNodes = generalWalletInfoResponse.connectedNodes;
if (this.percentSyncedNumber.toFixed(0) === "100" && this.lastBlockSyncedHeight != this.chainTip) {
this.percentSyncedNumber = 99;
}
if (this.chainTip === 0) {
this.chainTip = 1;
}
this.percentSyncedNumber = ((this.lastBlockSyncedHeight / this.chainTip) * 100);
if (this.percentSyncedNumber.toFixed(0) === "100" && this.lastBlockSyncedHeight != this.chainTip) {
this.percentSyncedNumber = 99;
}
this.percentSynced = this.percentSyncedNumber.toFixed(0);
this.percentSynced = this.percentSyncedNumber.toFixed(0);
}
},
error => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment