From a3a57b9508a596fd627157b2155579386c4e23ff Mon Sep 17 00:00:00 2001 From: Jaco Date: Thu, 17 Mar 2022 11:00:58 +0100 Subject: [PATCH] Unwrap active when field available (#7176) * Unwrap active when field available * || instead of ?? (less compile magic) --- packages/page-accounts/src/Accounts/Account.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/page-accounts/src/Accounts/Account.tsx b/packages/page-accounts/src/Accounts/Account.tsx index 87f79ea593..bc9d02153c 100644 --- a/packages/page-accounts/src/Accounts/Account.tsx +++ b/packages/page-accounts/src/Accounts/Account.tsx @@ -132,9 +132,10 @@ function Account ({ account: { address, meta }, className = '', delegation, filt useEffect((): void => { if (balancesAll) { setBalance(address, { - bonded: stakingInfo?.stakingLedger.active.unwrap() ?? BN_ZERO, + // some chains don't have "active" in the Ledger + bonded: stakingInfo?.stakingLedger.active?.unwrap() || BN_ZERO, locked: balancesAll.lockedBalance, - redeemable: stakingInfo?.redeemable ?? BN_ZERO, + redeemable: stakingInfo?.redeemable || BN_ZERO, total: balancesAll.freeBalance.add(balancesAll.reservedBalance), transferrable: balancesAll.availableBalance, unbonding: calcUnbonding(stakingInfo)