mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
@@ -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);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user