diff --git a/src/app/components/Header/contents.tsx b/src/app/components/Header/contents.tsx index f625da1..b280652 100644 --- a/src/app/components/Header/contents.tsx +++ b/src/app/components/Header/contents.tsx @@ -37,7 +37,9 @@ export const HeaderContent = ({ user }: { user?: User }) => { const selectedClass = classes.find((Class) => Class.id === selectedClassId); useEffect(() => { - setSelectedClassId(classes[0]?.id ?? null); + if (!selectedClass && classes.length > 0) { + setSelectedClassId(classes[0].id); + } }, [selectedClass, classes, setSelectedClassId]); return (