Browse Source

test: history API code update

Added condition to only referesh history if the history length changes
at next history refresh time.
still need to confirm if it works as expected.
master
Satinder Grewal 8 years ago
parent
commit
1a9c3277d8
  1. 6
      assets/scripts/dashboard.js

6
assets/scripts/dashboard.js

@ -295,7 +295,7 @@ function ShowCoinHistory(getData) {
ClearOnLogout(true, true);
}
if ( JSON.parse(CheckLoginData).status === 'unlocked' ) {
//console.log(getData.vals['coin']);
console.log(getData.vals['coin']);
$.ajax({
type: 'POST',
data: JSON.stringify(getData),
@ -326,6 +326,8 @@ 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 ) {
$.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);
@ -346,7 +348,9 @@ function ShowCoinHistory(getData) {
wallettblContent += '</tr>';
$('table[data-currency="' + getData.vals['coin'] + '"][id="currency-tbl"] tbody').html(wallettblContent);
//$('#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);

Loading…
Cancel
Save