avoid computing alternative currency rate when no txs in history

This commit is contained in:
Ivan Socolsky 2014-12-03 09:45:45 -03:00
parent d511103081
commit 120fcafeda
1 changed files with 15 additions and 13 deletions

View File

@ -85,6 +85,7 @@ angular.module('copayApp.controllers').controller('HistoryController',
tx.amount = $filter('noFractionNumber')(tx.amount);
});
if (items.length > 0) {
var index = _.indexBy(items, 'rateTs');
rateService.getHistoricRates(w.settings.alternativeIsoCode, _.keys(index), function(err, res) {
if (!err && res) {
@ -98,6 +99,7 @@ angular.module('copayApp.controllers').controller('HistoryController',
}, 1);
}
});
}
$scope.blockchain_txs = w.cached_txs = items;
$scope.nbPages = res.nbPages;