From d86ae5a208164a5091e310fdb9d35389cf396a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi?= Date: Fri, 10 Jan 2025 00:57:32 +0100 Subject: [PATCH] partialFix: need to be re-check --- src/app/components/Header/contents.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 (