Browse Source

addcoin function bug fixed

master
Satinder Grewal 9 years ago
parent
commit
770f621199
  1. 12
      assets/scripts/dashboard.js
  2. 32
      assets/scripts/iguana_api.js

12
assets/scripts/dashboard.js

@ -314,12 +314,12 @@ function ShowCoinHistory(getData) {
//console.log(testhistory.history.reverse());
//console.log(testhistory.sent);
$('span[data-currency="' + getData.vals['coin'] + '"][id="currency-balance"]').text(CoinHistoryData.balance);
/*$('span[data-currency="' + getData.vals['coin'] + '"][id="currency-balance"]').text(CoinHistoryData.balance);
//Update Dashboard Header values as well
if ( getData.vals['coin'] == 'BTC' || getData.vals['coin'] == 'BTCD' ) {
$('span[data-currency="' + getData.vals['coin'] + '"][id="header_coinbalance"]').text(CoinHistoryData.balance);
}
}*/
//Calculate Total Fiat Value of BTC/BTCD in Fiat and disaply on Dashboard
//TotalFiatValue();
@ -327,7 +327,7 @@ function ShowCoinHistory(getData) {
var show_coin_history = CoinHistoryData; //Enable to get history from each coins's wallet address.
//var show_coin_history = testhistory; //Enable to get history from just test variable.
if ( sessionStorage.getItem('PrevHistoryLength_'+getData.vals['coin']) != CoinHistoryData.history.length ) {
/*if ( sessionStorage.getItem('PrevHistoryLength_'+getData.vals['coin']) != CoinHistoryData.history.length ) {
$.each(show_coin_history.history.reverse(), function(coin_history_index){
//console.log(coin_history_index);
//console.log(show_coin_history.history[coin_history_index].details.vout);
@ -350,17 +350,17 @@ function ShowCoinHistory(getData) {
//$('#currency-tbl tbody').html(wallettblContent);
sessionStorage.setItem('PrevHistoryLength_'+getData.vals['coin'], CoinHistoryData.history.length);
});
}
}*/
//console.log(show_coin_history.history.length);
$('span[data-currency="' + getData.vals['coin'] + '"][id="currency-nooftransactions"]').text(show_coin_history.history.length);
//$('span[data-currency="' + getData.vals['coin'] + '"][id="currency-nooftransactions"]').text(show_coin_history.history.length);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
//ClearOnLogout(true, true);
ClearOnLogout(true, true);
}
console.log(textStatus);
console.log(error);

32
assets/scripts/iguana_api.js

@ -108,6 +108,37 @@ function Iguana_activehandle() {
return 'Executed Iguana_activehandle. Check Iguana_activehandle_output var value.';
}
function Iguana_Setactivehandle() {
//comment
var ajax_data = {"agent":"SuperNET","method":"activehandle"};
//console.log(ajax_data);
$.ajax({
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:7778',
//dataType: 'text',
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
var AjaxOutputDataToStore = JSON.stringify(data);
sessionStorage.setItem('IguanaActiveAccount', AjaxOutputDataToStore);
console.log('== SetActiveHandle Data OutPut ==');
console.log(AjaxOutputData);
},
error: function(xhr, textStatus, error) {
console.log('failed getting Coin History.');
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
Iguana_ServiceUnavailable();
}
console.log(textStatus);
console.log(error);
}
});
return 'Executed Iguana_activehandle. Check Iguana_activehandle_output var value.';
}
function Iguana_addcoinLogin(addcoin_data) {
//var addcoinValues = {"poll":100,"active":1,"agent":"iguana","method":"addcoin","newcoin":addcoin_data.coin,"startpend":1,"endpend":1,"services":128,"maxpeers":16,"RELAY":addcoin_data.mode,"VALIDATE":addcoin_data.mode,"portp2p":addcoin_data.portp2p};
console.log(addcoin_data);
@ -257,6 +288,7 @@ function Iguana_addcoin(addcoin_data) {
var addcoinData = JSON.parse(data);
if (addcoinData.result === 'coin added') {
Iguana_Setactivehandle();
console.log('coin added');
toastr.success(logincoinfullname+" started in "+ logincoinmodeinfo +" Mode", "Coin Notification");
//if ( typeof addcoin_data.reload == 'undefined' || addcoin_data.reload != false ) {

Loading…
Cancel
Save