diff --git a/frontend/src/components/ProjectTeacherComponent.tsx b/frontend/src/components/ProjectTeacherComponent.tsx index 71080837..45f51202 100644 --- a/frontend/src/components/ProjectTeacherComponent.tsx +++ b/frontend/src/components/ProjectTeacherComponent.tsx @@ -29,10 +29,12 @@ export function ProjectTeacherComponent(props: { updateTitle?: (name: string) => void, is_new?: boolean, }): JSX.Element { + const course_options = props.project.all_courses.filter(course => !course.course_archived).map(course => course.course_name); + const navigate = useNavigate(); const {t} = useTranslation(); const [projectName, setProjectName] = useState(props.project.projectName) - const [courseName, setCourseName] = useState(props.project.courseName) + const [courseName, setCourseName] = useState(course_options[0]) const [hours, setHours] = useState(props.project.hours); const [minutes, setMinutes] = useState(props.project.minutes); const [deadline, setDeadline] = useState(props.project.deadline); @@ -95,7 +97,6 @@ export function ProjectTeacherComponent(props: { } }; - const course_options = props.project.all_courses.filter(course => !course.course_archived).map(course => course.course_name); const hours_array = Array.from({length: 24}, (_, index) => index.toString()); const minutes_array = Array.from({length: 60}, (_, index) => index.toString());