diff --git a/src/components/AdminDashboard.tsx b/src/components/AdminDashboard.tsx index fea8de6..e80d7d0 100644 --- a/src/components/AdminDashboard.tsx +++ b/src/components/AdminDashboard.tsx @@ -1560,7 +1560,7 @@ export default function AdminDashboard({ token, adminUser, onLogout }: AdminDash const isUnlocked = !course.isLocked || selectedStudentDetails.unlockedCourses?.includes(course.id); if (!isUnlocked) return null; - const courseLessons = course.modules.flatMap(m => m.lessons) || []; + const courseLessons = course.modules?.flatMap(m => m.lessons) || []; const studentReactions = selectedStudentDetails.lessonReactions || []; const studentProgress = selectedStudentDetails.progress || []; diff --git a/src/components/CourseView.tsx b/src/components/CourseView.tsx index 242ee53..30e17ea 100644 --- a/src/components/CourseView.tsx +++ b/src/components/CourseView.tsx @@ -157,6 +157,7 @@ export default function CourseView({ courseId, token, onBack, initialLessonId }: }) }; })); + setActiveLesson(prev => prev ? { ...prev, reaction: type } : null); } } catch (err) { console.error('Error saving reaction:', err);