From e9f12bc2baea2ade15f0d537053f6b9794b0dcbc Mon Sep 17 00:00:00 2001 From: Dennis Thiessen Date: Wed, 18 Feb 2026 13:18:49 +0100 Subject: [PATCH] recording cutoff bug in admin fixed --- frontend/js/voice.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/js/voice.js b/frontend/js/voice.js index b78dc85..ab31b47 100644 --- a/frontend/js/voice.js +++ b/frontend/js/voice.js @@ -113,13 +113,14 @@ class VoiceManager { await this._transcribeAPI(blob); }; - // Wait for recorder to actually start before updating UI - this.mediaRecorder.start(); + // Only update UI once recording has truly started + this.mediaRecorder.onstart = () => { + this.isRecording = true; + this.lastInputWasVoice = true; + if (this.onStateChange) this.onStateChange(true); + }; - // Now we are truly recording - this.isRecording = true; - this.lastInputWasVoice = true; - if (this.onStateChange) this.onStateChange(true); + this.mediaRecorder.start(); } catch (e) { console.error('[Voice] Mic access error:', e);