Skip to content

Commit 8900684

Browse files
committed
bad bad ux warning
1 parent dcf0b4f commit 8900684

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

frontend/src/components/Schedule.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ const MissingYearNotice = styled.p`
2020
`;
2121

2222
export default function Schedule({ onChange, profile, schedule }) {
23+
const hasLoadedProfile = profile !== null;
24+
const shouldShowMissingYearNotice = hasLoadedProfile && !profile?.classYear;
25+
2326
useEffect(() => {
2427
if (schedule === null) {
2528
apiFetch('/api/v1/get_schedule/')
@@ -90,7 +93,7 @@ export default function Schedule({ onChange, profile, schedule }) {
9093

9194
return (
9295
<>
93-
{!profile?.classYear && (
96+
{shouldShowMissingYearNotice && (
9497
<MissingYearNotice className="warning-text">
9598
Set your class year in Settings to label semesters correctly.
9699
</MissingYearNotice>

0 commit comments

Comments
 (0)