diff --git a/assets/scripts/dashboard.js b/assets/scripts/dashboard.js index 0138cb1..abaf607 100644 --- a/assets/scripts/dashboard.js +++ b/assets/scripts/dashboard.js @@ -1,5 +1,5 @@ -var RunShowCoinHistory = ''; var RunTotalFiatValue = ''; +var ExecuteShowCoinHistory = ''; var Dashboard = function() { @@ -176,7 +176,15 @@ var Dashboard = function() { //Get coin history and pupulate balance and other info to wallet widget var historyvalues = {"timeout":20000,"agent":"basilisk","method":"history","vals":{"coin":"" + AllcoinsDataOutput[value][index] + ""}}; - RunShowCoinHistory = setInterval(function() { ShowCoinHistory(historyvalues); /*console.log('wallet widget refereshed (every 1 seconds)');*/ }, 1000); + var ExecuteShowCoinHistory = setInterval(function() { + if ( sessionStorage.getItem('IguanaActiveAccount') === null ) { + clearInterval(ExecuteShowCoinHistory); + console.log('=> No wallet logged in. No need to Run History.'); + } else { + ShowCoinHistory(historyvalues); + /*console.log('wallet widget refereshed (every 1 seconds)');*/ + } + }, 1000); }); }, @@ -330,7 +338,7 @@ function ShowCoinHistory(getData) { } function StopShowCoinHistory() { - clearInterval(RunShowCoinHistory); + clearInterval(ExecuteShowCoinHistory); console.log('Stopped executing History API.'); } diff --git a/assets/scripts/login.js b/assets/scripts/login.js index b0bcb6b..b64102c 100644 --- a/assets/scripts/login.js +++ b/assets/scripts/login.js @@ -83,6 +83,7 @@ var Login = function() { $('#wallet-core').fadeIn(); $('body').removeClass( "page-login layout-full page-dark" ).addClass( "" ); $('link[id=loginStyle]')[0].disabled=true; + location.reload(); } else { // If something goes wrong, alert the error message that our service returned @@ -102,7 +103,7 @@ var Login = function() { "portp2p": 14631 } //Start BitcoinDark in Basilisk mode - $.ajax({ + /*$.ajax({ type: 'GET', data: AddBTCDBasiliskData, url: 'http://127.0.0.1:7778/api/iguana/addcoin', @@ -132,7 +133,7 @@ var Login = function() { //swal("Oops...", "Something went wrong!", "error"); toastr.warning("Opps... Something went wrong!", "Coin Notification") } - }); + });*/ } else { toastr.warning("Opps... Something went wrong!", "Account Notification"); } @@ -373,6 +374,7 @@ var Login = function() { //Stop SetInterval Calls StopShowCoinHistory(); + StopTotalFiatValue(); } else {