From c05bd57fe124f31db390953aeafc7a5d11f429d2 Mon Sep 17 00:00:00 2001 From: retoor Date: Sun, 29 Jun 2025 21:03:33 +0200 Subject: [PATCH] Update. --- src/snek/static/stt.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/snek/static/stt.js b/src/snek/static/stt.js index 4ee6363..2694f65 100644 --- a/src/snek/static/stt.js +++ b/src/snek/static/stt.js @@ -97,7 +97,7 @@ class STTButton extends HTMLElement { .replace(/\!/g, "!\n"); this.targetEl.value = ''; // punctuated; - this.simulateTypingWithEvents(this.targetEl, punctuated, 1).then(() => { + this.simulateTypingWithEvents(this.targetEl, punctuated, 0).then(() => { const chatInput = document.querySelector('chat-input'); chatInput.finalizeMessage(); }); @@ -116,15 +116,16 @@ class STTButton extends HTMLElement { el.focus(); if (el.isContentEditable) { - el.innerText = el.innerText.replace(new RegExp(previousInterim + '$'), interim); + el.innerText = el.innerText.replace(new RegExp(previousInterim + '$'), ''); } else { - el.value = interim + el.value = '' + // el.value = interim //el.value = el.value.replace(new RegExp(previousInterim + '$'), interim); } - /* + this.simulateTypingWithEvents(el, interim, 0).then(() => { previousInterim = interim; - });*/ + }); } };