From 736677bbe8a5a5be7684dbee19b85d1c6e6d5b7c Mon Sep 17 00:00:00 2001 From: mistakia <1823355+mistakia@users.noreply.github.com> Date: Thu, 23 May 2024 17:07:19 -0400 Subject: [PATCH] fix: handle missing `total_balance` daily ledger stats --- src/views/pages/ledger/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/pages/ledger/index.js b/src/views/pages/ledger/index.js index ed448a6c..e21eddcc 100644 --- a/src/views/pages/ledger/index.js +++ b/src/views/pages/ledger/index.js @@ -54,11 +54,11 @@ const mapStateToProps = createSelector(getLedger, (ledger) => { // calculate relative supply distribution const total_supply = base_ranges.reduce((acc, r) => { - return acc + BigInt(d[`${r}_total_balance`]) + return acc + BigInt(d[`${r}_total_balance`] || 0) }, BigInt(0)) base_ranges.forEach((r) => { - const total_balance = BigInt(d[`${r}_total_balance`]) + const total_balance = BigInt(d[`${r}_total_balance`] || 0) const relative_supply = BigNumber(total_balance) .div(total_supply) .times(100)