We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8198335 commit af17278Copy full SHA for af17278
components/chat.tsx
@@ -2,6 +2,7 @@
2
3
import { CHAT_ID } from '@/lib/constants'
4
import { Message, useChat } from 'ai/react'
5
+import { useEffect } from 'react'
6
import { toast } from 'sonner'
7
import { ChatMessages } from './chat-messages'
8
import { ChatPanel } from './chat-panel'
@@ -38,6 +39,10 @@ export function Chat({
38
39
}
40
})
41
42
+ useEffect(() => {
43
+ setMessages(savedMessages)
44
+ }, [id])
45
+
46
const onQuerySelect = (query: string) => {
47
append({
48
role: 'user',
@@ -46,7 +51,7 @@ export function Chat({
51
52
53
return (
49
- <div className="flex flex-col w-full max-w-3xl pt-10 pb-16 mx-auto stretch">
54
+ <div className="flex flex-col w-full max-w-3xl pt-10 pb-20 mx-auto stretch">
50
55
<ChatMessages
56
messages={messages}
57
onQuerySelect={onQuerySelect}
0 commit comments