fixed alternative rate not showing in history
This commit is contained in:
parent
8361f4453d
commit
cdbbad9f22
1 changed files with 6 additions and 6 deletions
|
|
@ -122,14 +122,14 @@ angular.module('copayApp.controllers').controller('HistoryController',
|
||||||
|
|
||||||
$scope._addRates = function(w, txs, cb) {
|
$scope._addRates = function(w, txs, cb) {
|
||||||
if (!txs || txs.length == 0) return cb();
|
if (!txs || txs.length == 0) return cb();
|
||||||
var index = _.indexBy(txs, 'rateTs');
|
var index = _.groupBy(txs, 'rateTs');
|
||||||
rateService.getHistoricRates(w.settings.alternativeIsoCode, _.keys(index), function(err, res) {
|
rateService.getHistoricRates(w.settings.alternativeIsoCode, _.keys(index), function(err, res) {
|
||||||
if (err) return cb(err);
|
if (err || !res) return cb(err);
|
||||||
if (!res) return cb();
|
|
||||||
_.each(res, function(r) {
|
_.each(res, function(r) {
|
||||||
var tx = index[r.ts];
|
_.each(index[r.ts], function (tx) {
|
||||||
var alternativeAmount = (r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null);
|
var alternativeAmount = (r.rate != null ? tx.amountSat * rateService.SAT_TO_BTC * r.rate : null);
|
||||||
tx.alternativeAmount = alternativeAmount ? $filter('noFractionNumber')(alternativeAmount, 2) : null;
|
tx.alternativeAmount = alternativeAmount ? $filter('noFractionNumber')(alternativeAmount, 2) : null;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
return cb();
|
return cb();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue