partialFix: need to be re-check

This commit is contained in:
Rémi 2025-01-10 00:57:32 +01:00
parent a1162c5771
commit d86ae5a208

View File

@ -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 (