From b4f26ddfb72aa74b0fc629a31e81d41e88d344d5 Mon Sep 17 00:00:00 2001 From: dsyoon Date: Wed, 28 Jan 2026 22:58:12 +0900 Subject: [PATCH] Finalize only on final results --- client/src/App.tsx | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index 928bf96..113160b 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -34,7 +34,6 @@ function App() { const isRecordingRef = useRef(false) const lastResultAtRef = useRef(Date.now()) const restartLockRef = useRef(false) - const finalizeTimerRef = useRef(null) const isStartingRef = useRef(false) const hasSpeechRecognition = useMemo(() => { @@ -129,13 +128,6 @@ function App() { }, ] }) - if (finalizeTimerRef.current) { - window.clearTimeout(finalizeTimerRef.current) - } - finalizeTimerRef.current = window.setTimeout(() => { - void commitLiveIfAny() - finalizeTimerRef.current = null - }, 1200) } } @@ -144,11 +136,6 @@ function App() { } recognition.onend = () => { - if (finalizeTimerRef.current) { - window.clearTimeout(finalizeTimerRef.current) - finalizeTimerRef.current = null - } - void commitLiveIfAny() liveTextRef.current = '' if (isRecordingRef.current) { window.setTimeout(() => { @@ -177,10 +164,6 @@ function App() { const handleFinalTranscript = async (text: string) => { const trimmed = text.trim() if (!trimmed) return - if (finalizeTimerRef.current) { - window.clearTimeout(finalizeTimerRef.current) - finalizeTimerRef.current = null - } lastResultAtRef.current = Date.now() const ts = new Date().toISOString() liveTextRef.current = ''