File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2
2
3
3
import { CHAT_ID } from '@/lib/constants'
4
4
import { Message , useChat } from 'ai/react'
5
+ import { useEffect } from 'react'
5
6
import { toast } from 'sonner'
6
7
import { ChatMessages } from './chat-messages'
7
8
import { ChatPanel } from './chat-panel'
@@ -38,6 +39,10 @@ export function Chat({
38
39
}
39
40
} )
40
41
42
+ useEffect ( ( ) => {
43
+ setMessages ( savedMessages )
44
+ } , [ id ] )
45
+
41
46
const onQuerySelect = ( query : string ) => {
42
47
append ( {
43
48
role : 'user' ,
@@ -46,7 +51,7 @@ export function Chat({
46
51
}
47
52
48
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
51
56
messages = { messages }
52
57
onQuerySelect = { onQuerySelect }
You can’t perform that action at this time.
0 commit comments