Merge pull request #37 from isocolsky/tx_date

added sentTs and minedTs to tx history
This commit is contained in:
Matias Alejo Garcia 2014-10-27 23:13:40 -03:00
commit 7afe921fd2
3 changed files with 16 additions and 11 deletions

View file

@ -64,6 +64,9 @@ angular.module('copayApp.controllers').controller('TransactionsController',
$scope.blockchain_txs = w.cached_txs = res; $scope.blockchain_txs = w.cached_txs = res;
$scope.loading = false; $scope.loading = false;
setTimeout(function() {
$scope.$digest();
}, 1);
}); });
}; };

View file

@ -977,13 +977,13 @@ Wallet.prototype.toObj = function() {
Wallet.fromUntrustedObj = function(obj, readOpts) { Wallet.fromUntrustedObj = function(obj, readOpts) {
obj = _.clone(obj); obj = _.clone(obj);
var o = {}; var o = {};
_.each(Wallet.PERSISTED_PROPERTIES, function(p) { _.each(Wallet.PERSISTED_PROPERTIES, function(p) {
o[p] = obj[p]; o[p] = obj[p];
}); });
return Wallet.fromObj(o,readOpts); return Wallet.fromObj(o, readOpts);
}; };
/** /**
@ -2518,10 +2518,10 @@ Wallet.prototype.close = function(cb) {
this.blockchain.destroy(); this.blockchain.destroy();
log.debug('## CLOSING Wallet: ' + this.id); log.debug('## CLOSING Wallet: ' + this.id);
// TODO // TODO
// this.lock.release(function() { // this.lock.release(function() {
if (cb) return cb(); if (cb) return cb();
// }); // });
}; };
/** /**
@ -2906,6 +2906,8 @@ Wallet.prototype.getTransactionHistory = function(cb) {
tx.labelTo = firstOut ? firstOut.label : undefined; tx.labelTo = firstOut ? firstOut.label : undefined;
tx.amountSat = Math.abs(amount); tx.amountSat = Math.abs(amount);
tx.amount = tx.amountSat * satToUnit; tx.amount = tx.amountSat * satToUnit;
tx.sentTs = proposal ? proposal.sentTs : undefined;
tx.minedTs = tx.time * 1000;
}; };
if (addresses.length > 0) { if (addresses.length > 0) {

View file

@ -40,13 +40,13 @@
<span class="btn-copy" clip-copy="btx.txid"></span> <span class="btn-copy" clip-copy="btx.txid"></span>
</div> </div>
<div class="large-4 medium-5 small-8 columns text-right"> <div class="large-4 medium-5 small-8 columns text-right">
<div data-ng-show="btx.firstSeenTs"> <div data-ng-show="btx.sentTs">
<span translate>first seen at</span> <span translate>broadcasted</span>
<time>{{btx.firstSeenTs * 1000 | amCalendar}}</time> <time>{{btx.sentTs | amCalendar}}</time>
</div> </div>
<div data-ng-show="btx.time && !btx.firstSeenTs"> <div data-ng-show="btx.minedTs">
<span translate>mined</span> <span translate>mined</span>
<time>{{btx.time * 1000 | amCalendar}}</time> <time>{{btx.minedTs | amCalendar}}</time>
</div> </div>
</div> </div>
</div> </div>