This commit is contained in:
retoor 2025-12-31 10:57:51 +01:00
parent 3689775efc
commit a59bbc213a

View File

@ -276,6 +276,11 @@ class STTButton extends HTMLElement {
} }
} }
_sendKeepListening() {
this._finalTranscript = '';
this._interimTranscript = '';
}
_stopAndSend() { _stopAndSend() {
if (this._finalTranscript.trim() || this._interimTranscript.trim()) { if (this._finalTranscript.trim() || this._interimTranscript.trim()) {
if (this._interimTranscript.trim()) { if (this._interimTranscript.trim()) {
@ -305,7 +310,7 @@ class STTButton extends HTMLElement {
if (textarea) { if (textarea) {
textarea.addEventListener('keydown', (e) => { textarea.addEventListener('keydown', (e) => {
if (e.key === 'Enter' && !e.shiftKey && this._isListening) { if (e.key === 'Enter' && !e.shiftKey && this._isListening) {
this._stopAndSend(); this._sendKeepListening();
} }
}); });
} }