ciyidogan commited on
Commit
222fddc
·
verified ·
1 Parent(s): d0acdba

Update flare-ui/src/app/services/conversation-manager.service.ts

Browse files
flare-ui/src/app/services/conversation-manager.service.ts CHANGED
@@ -198,11 +198,25 @@ export class ConversationManagerService implements OnDestroy {
198
  })
199
  );
200
 
201
- // Transcription updates
202
  this.subscriptions.add(
203
  this.wsService.transcription$.subscribe(result => {
204
- if (!result.is_final) {
205
- this.transcriptionSubject.next(result.text);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  }
207
  })
208
  );
 
198
  })
199
  );
200
 
201
+ // Subscribe to transcription updates
202
  this.subscriptions.add(
203
  this.wsService.transcription$.subscribe(result => {
204
+ console.log('📝 Transcription received:', result);
205
+
206
+ // HER ZAMAN transcription'ı güncelle (final olsun olmasın)
207
+ this.transcriptionSubject.next(result.text);
208
+
209
+ // Final ise mesaj olarak da ekle
210
+ if (result.is_final) {
211
+ const messages = this.messagesSubject.value;
212
+ const lastMessage = messages[messages.length - 1];
213
+ if (!lastMessage || lastMessage.role !== 'user' || lastMessage.text !== result.text) {
214
+ this.addMessage('user', result.text);
215
+ }
216
+ // Final olduktan sonra transcription'ı temizle
217
+ setTimeout(() => {
218
+ this.transcriptionSubject.next('');
219
+ }, 100);
220
  }
221
  })
222
  );