From 3c8b9c13b9fd1df02dc8daf379da20e43ca47316 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Wed, 4 Sep 2024 15:22:52 +0200 Subject: [PATCH] spot fix error markers boundary --- spot/entrypoints/content/SavingControls.tsx | 24 +++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/spot/entrypoints/content/SavingControls.tsx b/spot/entrypoints/content/SavingControls.tsx index 345d0cf55..b1dee10f6 100644 --- a/spot/entrypoints/content/SavingControls.tsx +++ b/spot/entrypoints/content/SavingControls.tsx @@ -18,7 +18,7 @@ interface ISavingControls { }, ) => void; getVideoData: () => Promise; - getErrorEvents: () => Promise<{title:string,time:number}> + getErrorEvents: () => Promise<{title:string,time:number}[]> } const base64ToBlob = (base64: string) => { @@ -51,7 +51,7 @@ function SavingControls({ onClose, getVideoData, getErrorEvents }: ISavingContro createEffect(() => { setTrimBounds([0, 0]); - getErrorEvents().then(r => { + getErrorEvents().then((r) => { setErrorEvents(r) }) }); @@ -219,6 +219,7 @@ function SavingControls({ onClose, getVideoData, getErrorEvents }: ISavingContro videoDuration = await getDuration(); } setDuration(videoDuration); + setErrorEvents(errorEvents.filter((ev: { time: number }) => ev.time < videoDuration)) void generateThumbnail(); }; @@ -324,15 +325,7 @@ function SavingControls({ onClose, getVideoData, getErrorEvents }: ISavingContro
{errorEvents().length ? ( -
- {errorEvents().map(e => ( -
- ))} -
+
) : null}
+
+ {errorEvents().map(e => ( +
+ ))} +