diff --git a/frontend/src/components/projects/ProjectCard.vue b/frontend/src/components/projects/ProjectCard.vue index 75ece8ba..16fde590 100644 --- a/frontend/src/components/projects/ProjectCard.vue +++ b/frontend/src/components/projects/ProjectCard.vue @@ -66,11 +66,10 @@ const { submissionStatus, getSubmissionStatusByProject } = useSubmissionStatus() /** * Return True if the user is in a group in this project. */ -function isInGroup(): Boolean { - return props.studentGroups.some(group => props.projectGroups.includes(group)); +function isInGroup(): boolean { + return props.studentGroups.some((group) => props.projectGroups.includes(group)); } - /* Watchers */ watch( props.course, diff --git a/frontend/src/components/projects/ProjectList.vue b/frontend/src/components/projects/ProjectList.vue index b9577d66..02a7156d 100644 --- a/frontend/src/components/projects/ProjectList.vue +++ b/frontend/src/components/projects/ProjectList.vue @@ -32,8 +32,9 @@ const { student, getStudentByID } = useStudents(); * Get the groups of the corresponding users */ function getUserGroups(): Group[] { - if (user.value?.isStudent()) { - return (student.value?.groups || []); + if (user.value !== null && user.value?.isStudent()) { + // eslint-disable-next-line @typescript-eslint/prefer-optional-chain + return student.value !== null && student.value.groups !== null ? student.value?.groups : []; } return []; } @@ -46,7 +47,7 @@ watch( user, () => { if (user.value !== null && user.value.isStudent()) { - getStudentByID(user.value.id) + getStudentByID(user.value.id); } }, {