From 1c89f47d1a962c53798f237f489dfa4dac14581d Mon Sep 17 00:00:00 2001 From: Sonata Green Date: Sat, 3 Sep 2016 15:28:05 -0500 Subject: [PATCH] show negative transactions --- js/page/wallet.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/js/page/wallet.js b/js/page/wallet.js index c5df10515..20a1089e2 100644 --- a/js/page/wallet.js +++ b/js/page/wallet.js @@ -120,22 +120,20 @@ var TransactionList = React.createClass({ } else { var transactionItems = [], condensedTransactions = {}; - results.forEach(function(tx) { var txid = tx["txid"]; if (!(txid in condensedTransactions)) { condensedTransactions[txid] = 0; } - condensedTransactions[txid] += parseFloat(tx["value"]); + condensedTransactions[txid] += parseFloat(tx["amount"]); }); - results.reverse().forEach(function(tx) { var txid = tx["txid"]; - if (condensedTransactions[txid] && condensedTransactions[txid] > 0) + if (condensedTransactions[txid] && condensedTransactions[txid] != 0) { transactionItems.push({ id: txid, - date: new Date(parseInt(tx["timestamp"]) * 1000), + date: new Date(parseInt(tx["time"]) * 1000), amount: condensedTransactions[txid] }); delete condensedTransactions[txid];