aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/pending-balance-calculator.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-09-14 06:02:05 +0800
committerDan Finlay <dan@danfinlay.com>2017-09-14 06:06:04 +0800
commita01921758b25d151cfb1c47d7235f59291c29945 (patch)
treef9453bd23f37c14267a6497befb9f6c15cb70da2 /app/scripts/lib/pending-balance-calculator.js
parent0ba649317592efced339980a729213876bc25a81 (diff)
downloadtangerine-wallet-browser-a01921758b25d151cfb1c47d7235f59291c29945.tar
tangerine-wallet-browser-a01921758b25d151cfb1c47d7235f59291c29945.tar.gz
tangerine-wallet-browser-a01921758b25d151cfb1c47d7235f59291c29945.tar.bz2
tangerine-wallet-browser-a01921758b25d151cfb1c47d7235f59291c29945.tar.lz
tangerine-wallet-browser-a01921758b25d151cfb1c47d7235f59291c29945.tar.xz
tangerine-wallet-browser-a01921758b25d151cfb1c47d7235f59291c29945.tar.zst
tangerine-wallet-browser-a01921758b25d151cfb1c47d7235f59291c29945.zip
Add computed balance to account detail view
Diffstat (limited to 'app/scripts/lib/pending-balance-calculator.js')
-rw-r--r--app/scripts/lib/pending-balance-calculator.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/scripts/lib/pending-balance-calculator.js b/app/scripts/lib/pending-balance-calculator.js
index 474ed3261..c66bffbbb 100644
--- a/app/scripts/lib/pending-balance-calculator.js
+++ b/app/scripts/lib/pending-balance-calculator.js
@@ -22,6 +22,8 @@ class PendingBalanceCalculator {
const balance = results[0]
const pending = results[1]
+ if (!balance) return undefined
+
const pendingValue = pending.reduce((total, tx) => {
return total.add(this.valueFor(tx))
}, new BN(0))