Browse Source

KMD: Activating Best Chain condition updated for wallet GUI

master
Satinder Grewal 8 years ago
parent
commit
8bd96d511b
  1. 28
      assets/scripts/kmd_wallet_dashboard.js

28
assets/scripts/kmd_wallet_dashboard.js

@ -263,7 +263,7 @@ jQuery(document).ready(function() {
} else if ( sessionStorage.getItem('NativeWalletActions') !== null || sessionStorage.getItem('NativeWalletActions') === "start") { } else if ( sessionStorage.getItem('NativeWalletActions') !== null || sessionStorage.getItem('NativeWalletActions') === "start") {
KMD_ProgressBar(); KMD_ProgressBar();
} }
}, 1000); }, 5000);
}); });
@ -1169,9 +1169,12 @@ function CheckIfConnected() {
var AjaxOutputData = JSON.parse(data); var AjaxOutputData = JSON.parse(data);
console.log('== Data OutPut =='); console.log('== Data OutPut ==');
console.log(AjaxOutputData.error); console.log(AjaxOutputData.error);
console.log(AjaxOutputData['error'].message);
if ( AjaxOutputData.errors != undefined ) { if ( AjaxOutputData.errors != undefined ) {
//console.log('connected'); //console.log('connected');
result.push('connected'); result.push('connected');
} else if ( AjaxOutputData['error'].message = 'Activating best chain...' ) {
result.push('activating');
} else if ( AjaxOutputData.errors == undefined) { } else if ( AjaxOutputData.errors == undefined) {
result.push('not active'); result.push('not active');
} else { } else {
@ -1251,6 +1254,8 @@ function KMD_getInfo_rtrn() {
if ( AjaxOutputData.errors != undefined ) { if ( AjaxOutputData.errors != undefined ) {
//console.log('connected'); //console.log('connected');
result.push(AjaxOutputData); result.push(AjaxOutputData);
} else if ( AjaxOutputData['error'].message = 'Activating best chain...' ) {
result.push('activating');
} else if ( AjaxOutputData.errors == undefined) { } else if ( AjaxOutputData.errors == undefined) {
result.push('not active'); result.push('not active');
} else { } else {
@ -1277,17 +1282,20 @@ function KMD_ProgressBar() {
var extcoin = $('[data-extcoin]').attr("data-extcoin"); var extcoin = $('[data-extcoin]').attr("data-extcoin");
var getinfotmp = KMD_getInfo_rtrn() var getinfotmp = KMD_getInfo_rtrn()
console.log(getinfotmp);
//console.log(getinfotmp.blocks); //console.log(getinfotmp.blocks);
//console.log(getinfotmp.connections); //console.log(getinfotmp.connections);
//console.log(getinfotmp.longestchain); //console.log(getinfotmp.longestchain);
if ( getinfotmp == 'activating') {
var sync_percent = parseFloat(parseInt(getinfotmp.blocks, 10) * 100)/ parseInt(getinfotmp.longestchain, 10); $('span[data-extcoin="'+extcoin+'"][id="extcoin-sync-percent"]').text('Activating... Please wait');
console.log(parseFloat(sync_percent).toFixed(2)+'%') } else {
$('div[data-extcoin="'+extcoin+'"][id="extcoin-sync"]').width(parseFloat(sync_percent).toFixed(2)+'%'); var sync_percent = parseFloat(parseInt(getinfotmp.blocks, 10) * 100)/ parseInt(getinfotmp.longestchain, 10);
$('span[data-extcoin="'+extcoin+'"][id="extcoin-sync-percent"]').text(parseFloat(sync_percent).toFixed(2)+'%'); console.log(parseFloat(sync_percent).toFixed(2)+'%')
$('span[data-extcoin="'+extcoin+'"][id="extcoin-synced-blocks"]').text(getinfotmp.blocks); $('div[data-extcoin="'+extcoin+'"][id="extcoin-sync"]').width(parseFloat(sync_percent).toFixed(2)+'%');
$('span[data-extcoin="'+extcoin+'"][id="extcoin-longestchain"]').text(getinfotmp.longestchain); $('span[data-extcoin="'+extcoin+'"][id="extcoin-sync-percent"]').text(parseFloat(sync_percent).toFixed(2)+'%');
$('span[data-extcoin="'+extcoin+'"][id="extcoin-connections"]').text(getinfotmp.connections); $('span[data-extcoin="'+extcoin+'"][id="extcoin-synced-blocks"]').text(' | '+getinfotmp.blocks);
$('span[data-extcoin="'+extcoin+'"][id="extcoin-longestchain"]').text(' / '+getinfotmp.longestchain);
$('span[data-extcoin="'+extcoin+'"][id="extcoin-connections"]').text(' | Connections: '+getinfotmp.connections);
}
} }

Loading…
Cancel
Save