Commit 473cee7a authored by dev0tion's avatar dev0tion

Fix sync percentage display

parent 682ddea2
...@@ -18,7 +18,7 @@ export class StatusBarComponent implements OnInit { ...@@ -18,7 +18,7 @@ export class StatusBarComponent implements OnInit {
private lastBlockSyncedHeight: number; private lastBlockSyncedHeight: number;
private chainTip: number; private chainTip: number;
private connectedNodes: number = 0; private connectedNodes: number = 0;
private percentSynced: number = 100; private percentSynced: string;
constructor(private apiService: ApiService, private globalService: GlobalService) { } constructor(private apiService: ApiService, private globalService: GlobalService) { }
...@@ -40,7 +40,7 @@ export class StatusBarComponent implements OnInit { ...@@ -40,7 +40,7 @@ export class StatusBarComponent implements OnInit {
this.lastBlockSyncedHeight = generalWalletInfoResponse.lastBlockSyncedHeight; this.lastBlockSyncedHeight = generalWalletInfoResponse.lastBlockSyncedHeight;
this.chainTip = generalWalletInfoResponse.chainTip; this.chainTip = generalWalletInfoResponse.chainTip;
this.connectedNodes = generalWalletInfoResponse.connectedNodes; this.connectedNodes = generalWalletInfoResponse.connectedNodes;
this.percentSynced = (this.chainTip / this.lastBlockSyncedHeight) * 100 this.percentSynced = ((this.lastBlockSyncedHeight / this.chainTip) * 100).toFixed(0);
} }
}, },
error => { 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