Skip to content

Commit 197323b

Browse files
leslieyip02zwliew
andauthored
fix(website/ta): Prevent duplicate TA lessons in timetable (#3942)
Co-authored-by: Zhao Wei Liew <[email protected]>
1 parent e7a5a51 commit 197323b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

website/src/views/timetable/TimetableContent.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,13 @@ class TimetableContent extends React.Component<Props, State> {
369369
title: module.title,
370370
};
371371

372+
// Prevent multiple versions of the same lesson
373+
if (
374+
timetableLessons.some((curLesson) => areLessonsSameClass(modifiableLesson, curLesson))
375+
) {
376+
return;
377+
}
378+
372379
// All lessons added within this block are options to be added in the timetable
373380
// Except for the activeLesson
374381
modifiableLesson.isOptionInTimetable = true;

0 commit comments

Comments
 (0)