chore: fix

This commit is contained in:
Lluis Agusti
2026-01-30 12:20:46 +07:00
parent 715384eb06
commit 35c236cbe4

View File

@@ -103,13 +103,6 @@ export function useVoiceRecording({
console.error("Transcription error:", err);
} finally {
setIsTranscribing(false);
// Refocus the input after transcription so user can continue typing or send
if (inputId) {
const inputElement = document.getElementById(inputId);
if (inputElement) {
inputElement.focus();
}
}
}
},
[handleTranscription, inputId],
@@ -210,6 +203,15 @@ export function useVoiceRecording({
}
}, [error, toast]);
useEffect(() => {
if (!isTranscribing && inputId) {
const inputElement = document.getElementById(inputId);
if (inputElement) {
inputElement.focus();
}
}
}, [isTranscribing, inputId]);
const handleKeyDown = useCallback(
(event: KeyboardEvent<HTMLTextAreaElement>) => {
if (event.key === " " && !value.trim() && !isTranscribing) {