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 => ( +
+ ))} +