Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/apps/copilots/src/models/CopilotOpportunity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ export interface CopilotOpportunity {
startDate: Date,
tzRestrictions: 'yes' | 'no',
createdAt: Date,
members: Array<number>,
canApplyAsCopilot: boolean,
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ const CopilotOpportunityDetails: FC<{}> = () => {
}

const application = copilotApplications && copilotApplications[0]
const isAlreadyMemberOfTheProject = profile && opportunity?.members?.includes(profile.userId)

return (
<ContentLayout
Expand All @@ -135,7 +134,7 @@ const CopilotOpportunityDetails: FC<{}> = () => {
&& copilotApplications
&& copilotApplications.length === 0
&& opportunity?.status === 'active'
&& !isAlreadyMemberOfTheProject ? applyCopilotOpportunityButton : undefined
&& opportunity?.canApplyAsCopilot ? applyCopilotOpportunityButton : undefined

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider checking if opportunity?.canApplyAsCopilot is explicitly false to ensure that the button is not rendered when it should not be. This can help avoid potential issues if canApplyAsCopilot is undefined or null.

}
infoComponent={(isCopilot && !(copilotApplications
&& copilotApplications.length === 0
Expand Down