Skip to content

Commit 19c3d50

Browse files
authoredJul 19, 2024··
fix (ai/ui): add missing createdAt (#2342)
1 parent 89947fc commit 19c3d50

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed
 

‎.changeset/shaggy-insects-design.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@ai-sdk/react': patch
3+
'@ai-sdk/vue': patch
4+
---
5+
6+
fix (ai/ui): add missing createdAt

‎packages/react/src/use-chat.ts

+1
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ By default, it's set to 0, which will disable the feature.
579579
messages: input
580580
? messagesRef.current.concat({
581581
id: generateId(),
582+
createdAt: new Date(),
582583
role: 'user',
583584
content: input,
584585
experimental_attachments:

‎packages/vue/src/use-chat.ts

+1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ export function useChat({
282282
inputValue
283283
? messages.value.concat({
284284
id: generateId(),
285+
createdAt: new Date(),
285286
content: inputValue,
286287
role: 'user',
287288
})

0 commit comments

Comments
 (0)
Please sign in to comment.