Browse Source

fixed CheckIfConnected async false

master
Petr Balashov 8 years ago
parent
commit
4d4c0bcc6e
  1. 2
      assets/scripts/dashboard.js
  2. 5
      assets/scripts/kmd_wallet/KMDInit.js
  3. 11
      assets/scripts/kmd_wallet_dashboard.js

2
assets/scripts/dashboard.js

@ -1085,7 +1085,7 @@ var Dashboard = function() {
});
}
}, 1000);
}, 10000);
var FetchBasiliskData = setInterval(function() {
var active_edexcoin = $('[data-edexcoin]').attr('data-edexcoin'),

5
assets/scripts/kmd_wallet/KMDInit.js

@ -15,7 +15,7 @@ function RunKMDInitFunctions() {
});
NProgress.start();
var check1 = CheckIfConnected();
function _RunKMDInitFunctions(check1) {
console.log(check1[0]);
if ( check1[0] == 'not active' ) {
console.log('Could not connect to external wallet. Is external wallet running?');
@ -166,4 +166,7 @@ function RunKMDInitFunctions() {
$('#kmd_wallet_recieve_section').hide();
NProgress.done();
}
CheckIfConnected(_RunKMDInitFunctions);
}

11
assets/scripts/kmd_wallet_dashboard.js

@ -55,7 +55,7 @@ function getPassthruAgent() {
return passthru_agent;
}
function CheckIfConnected() {
function CheckIfConnected(cb) {
var result = [],
extcoin = $('[data-extcoin]').attr('data-extcoin'),
passthru_agent = getPassthruAgent(),
@ -82,7 +82,7 @@ function CheckIfConnected() {
console.log(ajax_data);
$.ajax({
async: false,
//async: false,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
@ -98,6 +98,8 @@ function CheckIfConnected() {
} else {
result.push(AjaxOutputData.errors);
}
cb.call(this, result);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
@ -107,12 +109,15 @@ function CheckIfConnected() {
}
console.log(textStatus);
console.log(error);
cb.call(this, result);
}
});
return result;
}
// TODO: this func is not used anywhere
function CheckIfWalletEncrypted() {
var result = [],
passthru_agent = getPassthruAgent(),
@ -195,7 +200,6 @@ function KMD_getInfo_rtrn(cb) {
}
$.ajax({
//async: true,
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:' + config.iguanaPort,
@ -222,6 +226,7 @@ function KMD_getInfo_rtrn(cb) {
}
console.log(textStatus);
console.log(error);
cb.call(this, result);
}
});

Loading…
Cancel
Save