partialFix: need to be re-check
This commit is contained in:
parent
a1162c5771
commit
d86ae5a208
@ -37,7 +37,9 @@ export const HeaderContent = ({ user }: { user?: User }) => {
|
|||||||
const selectedClass = classes.find((Class) => Class.id === selectedClassId);
|
const selectedClass = classes.find((Class) => Class.id === selectedClassId);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSelectedClassId(classes[0]?.id ?? null);
|
if (!selectedClass && classes.length > 0) {
|
||||||
|
setSelectedClassId(classes[0].id);
|
||||||
|
}
|
||||||
}, [selectedClass, classes, setSelectedClassId]);
|
}, [selectedClass, classes, setSelectedClassId]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user