Skip to content

Commit

Permalink
fix: findLast alternative
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinBuyck committed Sep 10, 2024
1 parent 9f410b6 commit 8107a93
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sites/partners/src/pages/listings/[id]/lottery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ const Lottery = (props: { listing: Listing | undefined }) => {
(event) => event.type === ListingEventsTypeEnum.publicLottery
)
if (listing.lotteryStatus === LotteryStatusEnum.releasedToPartners) {
const lotteryReleaseDate = lotteryActivityLogData?.findLast(
(logItem) => logItem.status === LotteryStatusEnum.releasedToPartners
)?.logDate
// reverse array to find most recent release date
const lotteryReleaseDate = lotteryActivityLogData
?.reverse()
?.find((logItem) => logItem.status === LotteryStatusEnum.releasedToPartners)?.logDate
return (
<CardSection>
<Icon size="xl">
Expand Down

0 comments on commit 8107a93

Please sign in to comment.