Skip to content

Commit a19973b

Browse files
Merge pull request #70 from boldare/fix/annotations
fix: displaying multiple annotations in a single message
2 parents 7627db1 + e51bca4 commit a19973b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

apps/spa/src/app/modules/+chat/shared/chat.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,13 @@ export class ChatService {
204204
this.isTyping$.next(false);
205205
this.isResponding$.next(false);
206206

207+
const lastChatMessage = this.messages$.value.pop();
208+
(lastChatMessage?.content?.[0] as TextContentBlock).text.annotations = event.data.text.annotations
209+
207210
this.messages$.next([
208-
...this.messages$.value.slice(0, -1),
211+
...this.messages$.value,
209212
{
210-
...this.messages$.value.pop(),
213+
...lastChatMessage,
211214
annotations: event.annotations,
212215
},
213216
]);

0 commit comments

Comments
 (0)