From 1f825528218e7d52c98920c2eddad04c2ca93109 Mon Sep 17 00:00:00 2001 From: Magic Cat Date: Wed, 4 Oct 2023 17:17:46 +0700 Subject: [PATCH] updated loading state --- packages/ui/src/screens/account_details/hooks.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/ui/src/screens/account_details/hooks.ts b/packages/ui/src/screens/account_details/hooks.ts index 6a3592468b..b33185e077 100644 --- a/packages/ui/src/screens/account_details/hooks.ts +++ b/packages/ui/src/screens/account_details/hooks.ts @@ -100,7 +100,7 @@ const formatBalance = (data: Data): BalanceType => { const rewardsAmount = formatToken(rewards, primaryTokenUnit); const commission = getDenom( - R.pathOr['coins']>>( + R.pathOr['coins']>>( [], ['commission', 'coins'], data @@ -170,7 +170,7 @@ const formatOtherTokens = (data: Data) => { const availableRawAmount = getDenom(available, x); const availableAmount = formatToken(availableRawAmount.amount, x); const rewardsRawAmount = rewards.reduce((a, b) => { - const coins = R.pathOr>([], ['coins'], b); + const coins = R.pathOr>([], ['coins'], b); const denom = getDenom(coins, x); return Big(a).plus(denom.amount).toPrecision(); }, '0'); @@ -248,11 +248,11 @@ export const useAccountDetails = () => { useEffect(() => { const formattedRawData: { - commission?: typeof commission['commission']; - accountBalances?: typeof available['accountBalances']; - delegationBalance?: typeof delegation['delegationBalance']; - unbondingBalance?: typeof unbonding['unbondingBalance']; - delegationRewards?: typeof rewards['delegationRewards']; + commission?: (typeof commission)['commission']; + accountBalances?: (typeof available)['accountBalances']; + delegationBalance?: (typeof delegation)['delegationBalance']; + unbondingBalance?: (typeof unbonding)['unbondingBalance']; + delegationRewards?: (typeof rewards)['delegationRewards']; } = {}; formattedRawData.commission = R.pathOr({ coins: [] }, ['commission'], commission); formattedRawData.accountBalances = R.pathOr({ coins: [] }, ['accountBalances'], available); @@ -270,6 +270,7 @@ export const useAccountDetails = () => { useEffect(() => { handleSetState((prevState) => ({ ...prevState, + loading: false, overview: { address: address ?? '', withdrawalAddress: withdrawalAddress.withdrawalAddress?.address ?? '',