Skip to content

Commit

Permalink
fix: displaying multiple annotations in a single message
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianmusial committed Jun 14, 2024
1 parent 40e49a4 commit e51bca4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/spa/src/app/modules/+chat/shared/chat.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,13 @@ export class ChatService {
this.isTyping$.next(false);
this.isResponding$.next(false);

const lastChatMessage = this.messages$.value.pop();
(lastChatMessage?.content?.[0] as TextContentBlock).text.annotations = event.data.text.annotations

this.messages$.next([
...this.messages$.value.slice(0, -1),
...this.messages$.value,
{
...this.messages$.value.pop(),
...lastChatMessage,
annotations: event.annotations,
},
]);
Expand Down

0 comments on commit e51bca4

Please sign in to comment.