Skip to content

Commit

Permalink
fix(CampaignDetail): handle campaigns without end date in apply button
Browse files Browse the repository at this point in the history
CC-2412-2-3
  • Loading branch information
Kechicode committed Dec 12, 2024
1 parent 7a6c891 commit f212707
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/views/CampaignDetail/Apply/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const ApplyCampaignButton = ({
const isRejected = applicationState === 'rejected'
const isNotApplied = !applicationState
const isAppliedDuringPeriod =
appliedAt && new Date(appliedAt) <= new Date(appEnd)
(appliedAt && appEnd && new Date(appliedAt) <= new Date(appEnd)) ||
(appliedAt && !appEnd)
const isApplicationStarted = now >= new Date(appStart)
const isActiveCampaign = campaign.state === 'active'

Expand Down

0 comments on commit f212707

Please sign in to comment.