From eaf0a2dbde4f097dc4221093073c79576e3110b0 Mon Sep 17 00:00:00 2001 From: Manank Patni Date: Sat, 17 Jun 2023 09:11:41 +0530 Subject: [PATCH] Fix Bignumber error Signed-off-by: Manank Patni --- src/modules/explorer/pages/ProposalDetails/index.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/modules/explorer/pages/ProposalDetails/index.tsx b/src/modules/explorer/pages/ProposalDetails/index.tsx index cc3646ac..965c18c1 100644 --- a/src/modules/explorer/pages/ProposalDetails/index.tsx +++ b/src/modules/explorer/pages/ProposalDetails/index.tsx @@ -195,13 +195,12 @@ export const ProposalDetails: React.FC = () => { // !dao?.data.ledger.find(l => l.holder.address.toLowerCase() === account.toLowerCase())?.staked.isZero() const parseReadableConfigValue = (configKey: any, value: BigNumber) => { - if (dao) { + if (dao && value) { switch (configKey) { case "frozen_extra_value": return parseUnits(value, dao.data.token.decimals).toString() case "slash_scale_value": return 100 - value.toNumber() - default: return value.toString() } @@ -415,7 +414,7 @@ export const ProposalDetails: React.FC = () => { {" "} to{" "} - {parseReadableConfigValue(key as keyof Proposal["metadata"]["config"], value)} + {parseReadableConfigValue(key as keyof Proposal["metadata"]["config"], value) ?? 0}