Update.
This commit is contained in:
parent
3689775efc
commit
a59bbc213a
@ -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();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user