fix future times
This commit is contained in:
parent
460b65d9ea
commit
4ffd6bd351
2 changed files with 6 additions and 21 deletions
|
|
@ -433,14 +433,15 @@ angular.module('copayApp.controllers').controller('indexController', function($r
|
||||||
};
|
};
|
||||||
|
|
||||||
self.setTxHistory = function(txs) {
|
self.setTxHistory = function(txs) {
|
||||||
var now = new Date();
|
var now = Math.floor(Date.now() / 1000);
|
||||||
var c = 0;
|
var c = 0;
|
||||||
self.txHistoryPaging = txs[self.limitHistory] ? true : false;
|
self.txHistoryPaging = txs[self.limitHistory] ? true : false;
|
||||||
lodash.each(txs, function(tx) {
|
lodash.each(txs, function(tx) {
|
||||||
tx.ts = tx.minedTs || tx.sentTs;
|
|
||||||
// no future transaction...
|
// no future transactions...
|
||||||
if (tx.ts > now)
|
if (tx.time > now)
|
||||||
ts.ts = now;
|
tx.time = now;
|
||||||
|
|
||||||
tx.rateTs = Math.floor((tx.ts || now) / 1000);
|
tx.rateTs = Math.floor((tx.ts || now) / 1000);
|
||||||
tx.amountStr = profileService.formatAmount(tx.amount); //$filter('noFractionNumber')(
|
tx.amountStr = profileService.formatAmount(tx.amount); //$filter('noFractionNumber')(
|
||||||
if (c < self.limitHistory) {
|
if (c < self.limitHistory) {
|
||||||
|
|
|
||||||
|
|
@ -959,22 +959,6 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
||||||
return this.alternativeIsoCode;
|
return this.alternativeIsoCode;
|
||||||
};
|
};
|
||||||
|
|
||||||
this._addRates = function(txs, cb) {
|
|
||||||
if (!txs || txs.length == 0) return cb();
|
|
||||||
var index = lodash.groupBy(txs, 'rateTs');
|
|
||||||
|
|
||||||
rateService.getHistoricRates(config.alternativeIsoCode, lodash.keys(index), function(err, res) {
|
|
||||||
if (err || !res) return cb(err);
|
|
||||||
lodash.each(res, function(r) {
|
|
||||||
lodash.each(index[r.ts], function(tx) {
|
|
||||||
var alternativeAmount = (r.rate != null ? tx.amount * rateService.SAT_TO_BTC * r.rate : null);
|
|
||||||
tx.alternativeAmount = alternativeAmount ? $filter('noFractionNumber')(alternativeAmount, 2) : null;
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return cb();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
this.openTxModal = function(btx) {
|
this.openTxModal = function(btx) {
|
||||||
var self = this;
|
var self = this;
|
||||||
var fc = profileService.focusedClient;
|
var fc = profileService.focusedClient;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue