diff --git a/src/snek/static/stt.js b/src/snek/static/stt.js index 6fa727d..0b3ca51 100644 --- a/src/snek/static/stt.js +++ b/src/snek/static/stt.js @@ -276,6 +276,11 @@ class STTButton extends HTMLElement { } } + _sendKeepListening() { + this._finalTranscript = ''; + this._interimTranscript = ''; + } + _stopAndSend() { if (this._finalTranscript.trim() || this._interimTranscript.trim()) { if (this._interimTranscript.trim()) { @@ -305,7 +310,7 @@ class STTButton extends HTMLElement { if (textarea) { textarea.addEventListener('keydown', (e) => { if (e.key === 'Enter' && !e.shiftKey && this._isListening) { - this._stopAndSend(); + this._sendKeepListening(); } }); }