Skip to content

Commit

Permalink
fix problem where targets, technical goals, and fields are undefined …
Browse files Browse the repository at this point in the history
…rather than having a length of zero if none of these are added to a proposal
  • Loading branch information
DJWalker42 committed Oct 9, 2024
1 parent 7329ec8 commit 08b8c79
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,28 +159,28 @@ function Observations() {
)
}

if (proposal.data?.targets?.length === 0 ||
proposal.data?.technicalGoals?.length === 0 ||
proposal.data?.fields?.length === 0) {
if (proposal.data?.targets === undefined ||
proposal.data?.technicalGoals === undefined ||
proposal.data?.fields === undefined) {
return (
<PanelFrame>
<Header/>
To create an observation please add the following:
<List>
{
proposal.data?.targets?.length === 0 &&
!proposal.data?.targets &&
<List.Item>
<TargetButton/>
</List.Item>
}
{
proposal.data?.technicalGoals?.length == 0 &&
!proposal.data?.technicalGoals &&
<List.Item>
<TechnicalGoalButton/>
</List.Item>
}
{
proposal.data.fields?.length == 0 &&
!proposal.data?.fields &&
<List.Item>
<ObservationFieldButton/>
</List.Item>
Expand Down

0 comments on commit 08b8c79

Please sign in to comment.