fix lessonMount

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-04 06:31:17 +08:00
parent beae8ce633
commit 8c4e3ef118
@@ -37,7 +37,13 @@ export default function LessonPageBuilder() {
const blocksSeeded = useRef(false);
useEffect(() => {
// The builder stays mounted across lesson navigations (route param change
// only), so local editor state must be reset by hand here — otherwise the
// previous lesson's blocks leak into the next lesson's editor.
(async () => {
setInitializing(true);
setBlocks([]);
blocksSeeded.current = false;
await fetchLesson(courseId, unitId, lessonId);
setInitializing(false);
})();