Skip to content

Commit

Permalink
fix: 과제 제출 버튼 활성화 조건 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
woowahan-cron committed Aug 14, 2024
1 parent c1ce22a commit 766743a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/src/pages/MissionView/MissionView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ const MissionView = () => {
const [mission, setMission] = useState<Mission | null>(null);
const description = mission?.description ?? "";

const submittable = !mission || mission.submittable;
const isMissionSubmittable =
!mission ||
mission?.submittable ||
mission?.status === MISSION_STATUS.SUBMITTABLE ||
mission?.status === MISSION_STATUS.SUBMITTING;

const missionLabel = getMissionLabel(
mission?.submitted ?? false,
mission?.status ?? MISSION_STATUS.UNSUBMITTABLE
Expand Down Expand Up @@ -94,7 +99,7 @@ const MissionView = () => {
</Button>
</li>
<li>
<Button type="button" onClick={routeToAssignmentSubmit} disabled={!submittable}>
<Button type="button" onClick={routeToAssignmentSubmit} disabled={!isMissionSubmittable}>
{missionLabel}
</Button>
</li>
Expand Down

0 comments on commit 766743a

Please sign in to comment.