From 21b666caad6c8702bda9e86c6e06738600c3a997 Mon Sep 17 00:00:00 2001 From: stefanpetkov90 Date: Fri, 7 Oct 2022 14:30:39 +0300 Subject: [PATCH] fix NaN error --- .../components/MyDelegations/index.tsx | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/containers/ValidatorDetails/components/MyDelegations/index.tsx b/src/containers/ValidatorDetails/components/MyDelegations/index.tsx index d640d8e..51787ac 100644 --- a/src/containers/ValidatorDetails/components/MyDelegations/index.tsx +++ b/src/containers/ValidatorDetails/components/MyDelegations/index.tsx @@ -310,21 +310,18 @@ const MyDelegations = () => { 2 )} - - CUDOS - - - - $ - {checkRewards.length - ? calculateValue( - formatNumber( - formatBigNum(new BigNumber(checkRewards[0].amount)), - 2 + + CUDOS + + + + $ + {checkRewards[0].amount.length + ? calculateValue( + formatBigNum(new BigNumber(checkRewards[0].amount)) ) - ) - : formatNumber(formatBigNum(new BigNumber(0)), 2)} - + : formatNumber(formatBigNum(new BigNumber(0)), 2)} +