From 013a033051dfe225483a811e9b1bb78cd3f338b5 Mon Sep 17 00:00:00 2001 From: jhyang0 Date: Tue, 8 Jul 2025 16:06:46 +0900 Subject: [PATCH] stt error fixed --- src/features/listen/stt/sttService.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/features/listen/stt/sttService.js b/src/features/listen/stt/sttService.js index 68d8ef2..e11d579 100644 --- a/src/features/listen/stt/sttService.js +++ b/src/features/listen/stt/sttService.js @@ -74,7 +74,7 @@ class SttService { } flushMyCompletion() { - if (!this.myCompletionBuffer.trim()) return; + if (!this.modelInfo || !this.myCompletionBuffer.trim()) return; const finalText = this.myCompletionBuffer.trim(); @@ -102,7 +102,7 @@ class SttService { } flushTheirCompletion() { - if (!this.theirCompletionBuffer.trim()) return; + if (!this.modelInfo || !this.theirCompletionBuffer.trim()) return; const finalText = this.theirCompletionBuffer.trim(); @@ -176,6 +176,11 @@ class SttService { // console.log(`[SttService] Initializing STT for provider: ${modelInfo.provider}`); const handleMyMessage = message => { + if (!this.modelInfo) { + console.log('[SttService] Ignoring message - session already closed'); + return; + } + if (this.modelInfo.provider === 'gemini') { const text = message.serverContent?.inputTranscription?.text || ''; if (text && text.trim()) { @@ -217,6 +222,11 @@ class SttService { }; const handleTheirMessage = message => { + if (!this.modelInfo) { + console.log('[SttService] Ignoring message - session already closed'); + return; + } + if (this.modelInfo.provider === 'gemini') { const text = message.serverContent?.inputTranscription?.text || ''; if (text && text.trim()) {