diff --git a/src/components/player/atoms/settings/SkipSegmentsView.tsx b/src/components/player/atoms/settings/SkipSegmentsView.tsx index ced3e2b8..4886e211 100644 --- a/src/components/player/atoms/settings/SkipSegmentsView.tsx +++ b/src/components/player/atoms/settings/SkipSegmentsView.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useMemo, useState } from "react"; import { useTranslation } from "react-i18next"; import { Button } from "@/components/buttons/Button"; @@ -20,6 +20,18 @@ export function SkipSegmentsView({ id }: { id: string }) { const { setCurrentOverlay } = useOverlayStack(); const [showSubmissionForm, setShowSubmissionForm] = useState(false); + // Memoize the segment object to prevent re-renders from clearing form inputs + const segmentData = useMemo( + () => ({ + type: "intro" as const, + start_ms: null, + end_ms: null, + confidence: null, + submission_count: 0, + }), + [], + ); + const handleSeek = (seconds: number) => { display?.setTime(seconds); }; @@ -108,13 +120,7 @@ export function SkipSegmentsView({ id }: { id: string }) { {showSubmissionForm && tidbKey && ( { setShowSubmissionForm(false); setCurrentOverlay("tidb-submission-success");