fix: mic transcript disappearing after stop
useMediaStreamASR cleanup() cleared partialTranscript on stop, causing live ASR text to vanish from QueryInput. Unlike video ASR (which has onFinalTranscript to persist via queryText), mic and system-audio hooks rely on partialTranscript for display. Keep partialTranscript populated with the final transcript instead of clearing it.
This commit is contained in:
parent
7bff4308b7
commit
7c03137577
|
|
@ -48,7 +48,10 @@ export function useMediaStreamASR({ wsUrl }: UseMediaStreamASRProps): UseMediaSt
|
||||||
lastStashRef.current = ''
|
lastStashRef.current = ''
|
||||||
if (currentText) {
|
if (currentText) {
|
||||||
setTranscript(currentText)
|
setTranscript(currentText)
|
||||||
setPartialTranscript('')
|
// Keep partialTranscript populated so the text remains visible in QueryInput
|
||||||
|
// after the user stops capture/listening. Unlike video ASR, mic/system-audio
|
||||||
|
// hooks have no onFinalTranscript callback to persist via queryText.
|
||||||
|
setPartialTranscript(currentText)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (streamRef.current) {
|
if (streamRef.current) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue