From 0052349ddc173984ea77113fc87f01b91f01782c Mon Sep 17 00:00:00 2001 From: hackrush Date: Sat, 11 Nov 2017 14:03:57 +0530 Subject: [PATCH 1/3] Use balance_delta in txn list --- ui/js/redux/selectors/wallet.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ui/js/redux/selectors/wallet.js b/ui/js/redux/selectors/wallet.js index 2c9b6704b..68bb9b469 100644 --- a/ui/js/redux/selectors/wallet.js +++ b/ui/js/redux/selectors/wallet.js @@ -21,8 +21,14 @@ export const selectTransactionItems = createSelector( const tx = byId[txid]; //ignore dust/fees - if (Math.abs(tx.amount) === Math.abs(tx.fee)) { - return; + if (Math.abs(tx.value) === Math.abs(tx.fee)) { + // it is fee only txn if all infos are also empty + if ( + tx.claim_info.length == 0 && + tx.support_info.length == 0 && + tx.update_info.length == 0 + ) + return; } let append = []; @@ -60,14 +66,14 @@ export const selectTransactionItems = createSelector( //value on transaction, amount on outpoint //amount is always positive, but should match sign of value const amount = parseFloat( - item.amount ? (item.value < 0 ? -1 : 1) * item.amount : item.value + item.amount ? item.balance_delta : item.value ); return { txid: txid, date: tx.timestamp ? new Date(parseInt(tx.timestamp) * 1000) : null, amount: amount, - fee: amount < 0 ? -1 * tx.fee / append.length : 0, + fee: amount < 0 ? -1 * tx.fee : 0, claim_id: item.claim_id, claim_name: item.claim_name, type: item.type || "send", From 9e82c59ae620a1396b1749a292f61a249a8ff025 Mon Sep 17 00:00:00 2001 From: hackrush Date: Sat, 11 Nov 2017 14:40:55 +0530 Subject: [PATCH 2/3] Added CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 611cf0743..fbb46d2c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ Web UI version numbers should always match the corresponding version of LBRY App * Fixed regression in #697 causing transaction screen to not load for new users (#755) * Fixed scriolling restore/reset/set (#729) * Fixed sorting by title for published files (#614) + * App now uses the new balance_delta field in the txn list. + * ### Deprecated * From 5d3fc936b8bea27416cf85b477e0f48a755407b8 Mon Sep 17 00:00:00 2001 From: hackrush Date: Fri, 17 Nov 2017 23:41:12 +0530 Subject: [PATCH 3/3] Changes --- ui/js/redux/selectors/wallet.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/js/redux/selectors/wallet.js b/ui/js/redux/selectors/wallet.js index 68bb9b469..15182b743 100644 --- a/ui/js/redux/selectors/wallet.js +++ b/ui/js/redux/selectors/wallet.js @@ -21,14 +21,14 @@ export const selectTransactionItems = createSelector( const tx = byId[txid]; //ignore dust/fees - if (Math.abs(tx.value) === Math.abs(tx.fee)) { - // it is fee only txn if all infos are also empty - if ( - tx.claim_info.length == 0 && - tx.support_info.length == 0 && - tx.update_info.length == 0 - ) - return; + // it is fee only txn if all infos are also empty + if ( + Math.abs(tx.value) === Math.abs(tx.fee) && + tx.claim_info.length == 0 && + tx.support_info.length == 0 && + tx.update_info.length == 0 + ) { + return; } let append = []; @@ -66,14 +66,14 @@ export const selectTransactionItems = createSelector( //value on transaction, amount on outpoint //amount is always positive, but should match sign of value const amount = parseFloat( - item.amount ? item.balance_delta : item.value + item.balance_delta ? item.balance_delta : item.value ); return { txid: txid, date: tx.timestamp ? new Date(parseInt(tx.timestamp) * 1000) : null, amount: amount, - fee: amount < 0 ? -1 * tx.fee : 0, + fee: amount < 0 ? -1 * tx.fee / append.length : 0, claim_id: item.claim_id, claim_name: item.claim_name, type: item.type || "send",