avoid computing alternative currency rate when no txs in history
This commit is contained in:
parent
d511103081
commit
120fcafeda
1 changed files with 15 additions and 13 deletions
|
|
@ -85,6 +85,7 @@ angular.module('copayApp.controllers').controller('HistoryController',
|
||||||
tx.amount = $filter('noFractionNumber')(tx.amount);
|
tx.amount = $filter('noFractionNumber')(tx.amount);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (items.length > 0) {
|
||||||
var index = _.indexBy(items, 'rateTs');
|
var index = _.indexBy(items, 'rateTs');
|
||||||
rateService.getHistoricRates(w.settings.alternativeIsoCode, _.keys(index), function(err, res) {
|
rateService.getHistoricRates(w.settings.alternativeIsoCode, _.keys(index), function(err, res) {
|
||||||
if (!err && res) {
|
if (!err && res) {
|
||||||
|
|
@ -98,6 +99,7 @@ angular.module('copayApp.controllers').controller('HistoryController',
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
$scope.blockchain_txs = w.cached_txs = items;
|
$scope.blockchain_txs = w.cached_txs = items;
|
||||||
$scope.nbPages = res.nbPages;
|
$scope.nbPages = res.nbPages;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue