Fix curriculum editor chapters persisting across lessons
Fixed bug where editing a lesson without chapters would show chapters from the previously edited lesson. The handleNewLesson function now explicitly initializes chapters to an empty array to prevent state from carrying over between lesson edits. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -194,6 +194,7 @@ export function CurriculumEditor({ productId }: CurriculumEditorProps) {
|
||||
mp4_url: '',
|
||||
video_host: 'youtube',
|
||||
release_at: '',
|
||||
chapters: [],
|
||||
});
|
||||
setLessonDialogOpen(true);
|
||||
};
|
||||
|
||||
@@ -389,7 +389,7 @@ All colors MUST be HSL.
|
||||
border: 1px solid rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.flex .flex-1 code {
|
||||
.flex > .flex-1 > code {
|
||||
background-color: #dedede;
|
||||
}
|
||||
}
|
||||
@@ -467,7 +467,7 @@ export default function ProductDetail() {
|
||||
className={`flex items-start gap-2 py-1 px-2 text-xs text-muted-foreground rounded transition-colors cursor-not-allowed opacity-60${isLastTimelineItem(lesson.chapters.length, chapterIndex) ? ' border-b-2 border-[#dedede] rounded-none' : ''}`}
|
||||
title="Beli bootcamp untuk mengakses materi ini"
|
||||
>
|
||||
<span className="font-mono w-10 text-center">
|
||||
<span className="font-mono w-12 text-center">
|
||||
{formatChapterTime(chapter.time)}
|
||||
</span>
|
||||
<span className="flex-1" dangerouslySetInnerHTML={{ __html: chapter.title }} />
|
||||
|
||||
Reference in New Issue
Block a user