From a09274495848cc401d21d3cb00ee7c5b0e2188a4 Mon Sep 17 00:00:00 2001 From: MerlinScheurer Date: Sat, 1 Feb 2025 15:05:53 +0100 Subject: [PATCH] Refac skip videoProgress update when currentTime equals video duration --- frontend/src/components/VideoPlayer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/VideoPlayer.tsx b/frontend/src/components/VideoPlayer.tsx index 58dc48d6..9677067c 100644 --- a/frontend/src/components/VideoPlayer.tsx +++ b/frontend/src/components/VideoPlayer.tsx @@ -88,7 +88,7 @@ const handleTimeUpdate = }); } - if (currentTime < 10) return; + if (currentTime < 10 && currentTime === Number(videoTag.currentTarget.duration)) return; if (Number((currentTime % 10).toFixed(1)) <= 0.2) { // Check progress every 10 seconds or else progress is checked a few times a second const videoProgressResponse = await updateVideoProgressById({