From 5c9404a8d90e335a0e16d537398c60154ad4b45b Mon Sep 17 00:00:00 2001 From: Nimit Haria Date: Sat, 3 Feb 2024 18:03:21 +0530 Subject: [PATCH] fix: linting errors --- src/components/Courses.tsx | 1 - src/components/VideoPlayer2.tsx | 4 +--- src/components/admin/ContentRendererClient.tsx | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/Courses.tsx b/src/components/Courses.tsx index c63b05e6e..451a7a476 100644 --- a/src/components/Courses.tsx +++ b/src/components/Courses.tsx @@ -22,7 +22,6 @@ export const Courses = ({ courses }: { courses: Course[] }) => { router.push(`/courses/${course.id}`); } }} - key={course.id} /> ))} diff --git a/src/components/VideoPlayer2.tsx b/src/components/VideoPlayer2.tsx index 3089abc7f..555531edc 100644 --- a/src/components/VideoPlayer2.tsx +++ b/src/components/VideoPlayer2.tsx @@ -95,7 +95,7 @@ export const VideoPlayer: FunctionComponent = ({ } interval = window.setInterval( async () => { - if (player.paused()) { + if (player?.paused()) { return; } const currentTime = player.currentTime(); @@ -125,8 +125,6 @@ export const VideoPlayer: FunctionComponent = ({ player.on('play', handleVideoProgress); player.on('ended', () => handleVideoEnded(interval)); return () => { - player.off('play'); - player.off('ended', () => handleVideoEnded(interval)); window.clearInterval(interval); }; }, [player, contentId]); diff --git a/src/components/admin/ContentRendererClient.tsx b/src/components/admin/ContentRendererClient.tsx index d778527fd..39a6c31a8 100644 --- a/src/components/admin/ContentRendererClient.tsx +++ b/src/components/admin/ContentRendererClient.tsx @@ -149,7 +149,7 @@ export const ContentRendererClient = ({ ) : null} - {!showChapters && ( + {!showChapters && metadata.segments?.length > 0 && (