Skip to content

Commit

Permalink
fix: show cosmos pending undelegation
Browse files Browse the repository at this point in the history
  • Loading branch information
kaladinlight committed Aug 27, 2024
1 parent ce240fa commit d715655
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d715655

Please sign in to comment.