@selfcommunity/react-templates 0.4.5-courses.149 → 0.4.5-courses.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,6 +70,13 @@ function Lesson(inProps) {
70
70
  ? (_d = currentSection.lessons[currentLessonIndex + 1]) === null || _d === void 0 ? void 0 : _d.locked
71
71
  : (_f = (_e = scCourse === null || scCourse === void 0 ? void 0 : scCourse.sections[currentSectionIndex + 1]) === null || _e === void 0 ? void 0 : _e.lessons[0]) === null || _f === void 0 ? void 0 : _f.locked);
72
72
  const [openDialog, setOpenDialog] = (0, react_1.useState)(false);
73
+ //EFFECTS
74
+ (0, react_1.useEffect)(() => {
75
+ setLessonId(lessonId);
76
+ }, [lessonId]);
77
+ (0, react_1.useEffect)(() => {
78
+ setSectionId(sectionId);
79
+ }, [sectionId]);
73
80
  (0, react_1.useEffect)(() => {
74
81
  if ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.sections) && currentData) {
75
82
  setCurrentSection(scCourse.sections[currentData.currentSectionIndex] || null);
@@ -68,6 +68,13 @@ export default function Lesson(inProps) {
68
68
  ? (_d = currentSection.lessons[currentLessonIndex + 1]) === null || _d === void 0 ? void 0 : _d.locked
69
69
  : (_f = (_e = scCourse === null || scCourse === void 0 ? void 0 : scCourse.sections[currentSectionIndex + 1]) === null || _e === void 0 ? void 0 : _e.lessons[0]) === null || _f === void 0 ? void 0 : _f.locked);
70
70
  const [openDialog, setOpenDialog] = useState(false);
71
+ //EFFECTS
72
+ useEffect(() => {
73
+ setLessonId(lessonId);
74
+ }, [lessonId]);
75
+ useEffect(() => {
76
+ setSectionId(sectionId);
77
+ }, [sectionId]);
71
78
  useEffect(() => {
72
79
  if ((scCourse === null || scCourse === void 0 ? void 0 : scCourse.sections) && currentData) {
73
80
  setCurrentSection(scCourse.sections[currentData.currentSectionIndex] || null);