From ccb138f605b7aca12e4540c3e93b0c8d2dd5e8e8 Mon Sep 17 00:00:00 2001 From: Ivan Socolsky Date: Thu, 23 Oct 2014 12:33:55 -0300 Subject: [PATCH] show label and comment in view --- js/models/Wallet.js | 6 +++--- test/Wallet.js | 4 ++-- views/send.html | 4 ++-- views/transactions.html | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/js/models/Wallet.js b/js/models/Wallet.js index 7a36b1f55..43352a086 100644 --- a/js/models/Wallet.js +++ b/js/models/Wallet.js @@ -3000,9 +3000,8 @@ Wallet.prototype.getTransactionHistory = function(cb) { }); var proposal = _.findWhere(proposals, { - ntxid: tx.txid + sentTxid: tx.txid }); - tx.comment = proposal ? proposal.comment : undefined; tx.labelTo = firstOut ? firstOut.label : undefined; tx.amountSat = Math.abs(amount); @@ -3010,7 +3009,8 @@ Wallet.prototype.getTransactionHistory = function(cb) { }; if (addresses.length > 0) { - self.blockchain.getTransactions(addresses, function(err, txs) { + var addressesStr = _.pluck(addresses, 'addressStr'); + self.blockchain.getTransactions(addressesStr, function(err, txs) { if (err) return cb(err); var history = _.map(txs, function(tx) { diff --git a/test/Wallet.js b/test/Wallet.js index 061ba9398..81c32d43a 100644 --- a/test/Wallet.js +++ b/test/Wallet.js @@ -2163,10 +2163,10 @@ describe('Wallet model', function() { }]); w.getTxProposals = sinon.stub().returns([{ - ntxid: 'id0', + sentTxid: 'id0', comment: 'My comment', }, { - ntxid: 'id1', + sentTxid: 'id1', comment: 'Another comment', }]); w.getTransactionHistory(function(err, res) { diff --git a/views/send.html b/views/send.html index 105f50d7b..d0e1cbac0 100644 --- a/views/send.html +++ b/views/send.html @@ -108,7 +108,7 @@ -
+
+ name="comment" placeholder="{{(wallet.isShared() ? 'Leave a private message to your copayers' : 'Add a private comment to identify the transaction') |translate}}" ng-model="commentText" ng-maxlength="100">
diff --git a/views/transactions.html b/views/transactions.html index 74889ef4e..673b07652 100644 --- a/views/transactions.html +++ b/views/transactions.html @@ -52,7 +52,8 @@
- {{btx.action}} + {{btx.action}} to {{btx.labelTo}} + {{btx.comment}}