fixed whenAvailable()

This commit is contained in:
Ivan Socolsky 2014-11-05 22:21:32 -03:00
commit b8a708c863
3 changed files with 14 additions and 9 deletions

View file

@ -89,7 +89,7 @@ RateService.prototype.isAvailable = function() {
};
RateService.prototype.whenAvailable = function(callback) {
if (!this.isAvailable()) {
if (this.isAvailable()) {
setTimeout(callback, 1);
} else {
this._queued.push(callback);

View file

@ -37,6 +37,7 @@ function TxProposal(opts) {
this.comment = opts.comment || null;
this.readonly = opts.readonly || null;
this.merchant = opts.merchant || null;
this.altCurrency = opts.altCurrency || null;
this._sync();
}

View file

@ -2866,19 +2866,23 @@ Wallet.prototype.getTransactionHistory = function(cb) {
type: 'out'
});
var proposal = _.findWhere(proposals, {
sentTxid: tx.txid
});
tx.comment = proposal ? proposal.comment : undefined;
tx.labelTo = firstOut ? firstOut.label : undefined;
tx.addressTo = firstOut ? firstOut.address : undefined;
tx.amountSat = Math.abs(amount);
tx.amount = tx.amountSat * satToUnit;
tx.sentTs = proposal ? proposal.sentTs : undefined;
tx.minedTs = !_.isNaN(tx.time) ? tx.time * 1000 : undefined;
tx.merchant = proposal ? proposal.merchant : undefined;
tx.peerActions = proposal ? proposal.peerActions : undefined;
tx.finallyRejected = proposal ? proposal.finallyRejected : undefined;
var proposal = _.findWhere(proposals, {
sentTxid: tx.txid
});
if (proposal) {
tx.comment = proposal.comment;
tx.sentTs = proposal.sentTs;
tx.merchant = proposal.merchant;
tx.peerActions = proposal.peerActions;
tx.finallyRejected = proposal.finallyRejected;
}
};
if (addresses.length > 0) {