From c616362e0f5d050ac4206135ec310e734860d645 Mon Sep 17 00:00:00 2001 From: Sidney Gomes Date: Sat, 25 Jul 2026 11:33:12 -0300 Subject: [PATCH] Corrigido estado de curtidas na interface do aluno e crash do modal do admin --- src/components/AdminDashboard.tsx | 2 +- src/components/CourseView.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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);