Spaces:
Building
Building
Update flare-ui/src/app/components/chat/realtime-chat.component.ts
Browse files
flare-ui/src/app/components/chat/realtime-chat.component.ts
CHANGED
@@ -372,6 +372,12 @@ export class RealtimeChatComponent implements OnInit, OnDestroy, AfterViewChecke
|
|
372 |
).subscribe(messages => {
|
373 |
this.messages = messages;
|
374 |
this.shouldScrollToBottom = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
});
|
376 |
|
377 |
// Subscribe to transcription
|
@@ -380,6 +386,13 @@ export class RealtimeChatComponent implements OnInit, OnDestroy, AfterViewChecke
|
|
380 |
).subscribe(text => {
|
381 |
this.currentTranscription = text;
|
382 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
383 |
}
|
384 |
|
385 |
ngAfterViewChecked(): void {
|
|
|
372 |
).subscribe(messages => {
|
373 |
this.messages = messages;
|
374 |
this.shouldScrollToBottom = true;
|
375 |
+
|
376 |
+
// Check if we have initial welcome message
|
377 |
+
if (messages.length === 1 && messages[0].role === 'assistant' && !this.isConversationActive) {
|
378 |
+
// Show welcome message
|
379 |
+
console.log('Welcome message received:', messages[0].text);
|
380 |
+
}
|
381 |
});
|
382 |
|
383 |
// Subscribe to transcription
|
|
|
386 |
).subscribe(text => {
|
387 |
this.currentTranscription = text;
|
388 |
});
|
389 |
+
|
390 |
+
// Load initial messages from session if available
|
391 |
+
const initialMessages = this.conversationManager.getMessages();
|
392 |
+
if (initialMessages.length > 0) {
|
393 |
+
this.messages = initialMessages;
|
394 |
+
this.shouldScrollToBottom = true;
|
395 |
+
}
|
396 |
}
|
397 |
|
398 |
ngAfterViewChecked(): void {
|