diff --git a/src/components/Course/components/Lesson/Materials/index.svelte b/src/components/Course/components/Lesson/Materials/index.svelte index b63334d4..bbb50c60 100644 --- a/src/components/Course/components/Lesson/Materials/index.svelte +++ b/src/components/Course/components/Lesson/Materials/index.svelte @@ -70,14 +70,14 @@ badgeValue = !!note ? 1 : 0; } else { badgeValue = - typeof video_url === 'string' ? video_url.split(',').length : 0; + typeof video_url === 'string' && !!video_url + ? video_url.split(',').length + : 0; } tab.badgeValue = badgeValue; return tab; }); - - console.log(`tabs`, tabs); } $: handleSave(prevMode); @@ -138,7 +138,7 @@ bind:value={$lesson.materials.video_url} onChange={() => ($isLessonDirty = true)} /> - {:else if $lesson.materials.video_url && $lesson.materials.video_url.includes('youtube')} + {:else if !!$lesson.materials.video_url && $lesson.materials.video_url.includes('youtube')} {#each $lesson.materials.video_url.split(',') as url}