From d715655d8da65ddeba5ec0bedb1834839a091c2b Mon Sep 17 00:00:00 2001 From: kaladinlight <35275952+kaladinlight@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:34:52 -0600 Subject: [PATCH] fix: show cosmos pending undelegation --- .../CosmosManager/Overview/WithdrawCard.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/features/defi/providers/cosmos/components/CosmosManager/Overview/WithdrawCard.tsx b/src/features/defi/providers/cosmos/components/CosmosManager/Overview/WithdrawCard.tsx index 3026be19e80..bf36d11c4e6 100644 --- a/src/features/defi/providers/cosmos/components/CosmosManager/Overview/WithdrawCard.tsx +++ b/src/features/defi/providers/cosmos/components/CosmosManager/Overview/WithdrawCard.tsx @@ -52,15 +52,11 @@ export const WithdrawCard = ({ asset, accountId: routeAccountId }: WithdrawCardP const undelegationEntries = useMemo(() => { if (!opportunityData) return [] - if ( - supportsUndelegations(opportunityData) && - opportunityData.undelegations.some(undelegation => - dayjs().isBefore(dayjs(undelegation.completionTime).unix()), - ) - ) { - return opportunityData.undelegations - } - return [] + if (!supportsUndelegations(opportunityData)) return [] + + return opportunityData.undelegations.filter( + undelegation => dayjs().unix() < undelegation.completionTime, + ) }, [opportunityData]) const hasUndelegations = Boolean(undelegationEntries?.length)