File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/components/ChallengeEditor/ChallengeViewTabs Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,12 @@ const ChallengeViewTabs = ({
8686
8787 const isSelfService = challenge . legacy . selfService
8888 const isDraft = challenge . status . toUpperCase ( ) === CHALLENGE_STATUS . DRAFT
89+ const isCopilot = challenge . legacy . selfServiceCopilot === loggedInUser . handle
90+ const canApprove = isCopilot && isDraft && isSelfService
91+ // only the copilot can launch AND
8992 // if this isn't self-service, permit launching if the challenge is draft
9093 // OR if this is self-service, permit launching if the challenge is approved
91- const canLaunch = ( ! isSelfService && isDraft ) || challenge . status . toUpperCase ( ) === CHALLENGE_STATUS . APPROVED
92- const isCopilot = challenge . legacy . selfServiceCopilot === loggedInUser . handle
94+ const canLaunch = isCopilot && ( ( ! isSelfService && isDraft ) || challenge . status . toUpperCase ( ) === CHALLENGE_STATUS . APPROVED )
9395
9496 return (
9597 < div className = { styles . list } >
@@ -136,7 +138,7 @@ const ChallengeViewTabs = ({
136138 ) }
137139 </ div >
138140 ) }
139- { isDraft && isSelfService && (
141+ { canApprove && (
140142 < div className = { styles . button } >
141143 < PrimaryButton
142144 text = 'Approve'
You can’t perform that action at this time.
0 commit comments