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);
|
const blocksSeeded = useRef(false);
|
||||||
|
|
||||||
useEffect(() => {
|
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 () => {
|
(async () => {
|
||||||
|
setInitializing(true);
|
||||||
|
setBlocks([]);
|
||||||
|
blocksSeeded.current = false;
|
||||||
await fetchLesson(courseId, unitId, lessonId);
|
await fetchLesson(courseId, unitId, lessonId);
|
||||||
setInitializing(false);
|
setInitializing(false);
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user