wuyiqunLu commited on
Commit
ade4562
1 Parent(s): 90876d6

fix: add jotai provider for different chat (#109)

Browse files

so different chat can have different context for messageId

Files changed (1) hide show
  1. app/chat/[id]/server.tsx +7 -4
app/chat/[id]/server.tsx CHANGED
@@ -4,6 +4,7 @@ import { dbGetChat } from '@/lib/db/functions';
4
  import { redirect } from 'next/navigation';
5
  import { revalidatePath } from 'next/cache';
6
  import TopPrompt from '@/components/chat/TopPrompt';
 
7
 
8
  interface ChatServerProps {
9
  chatId: string;
@@ -18,9 +19,11 @@ export default async function ChatServer({ chatId }: ChatServerProps) {
18
  redirect('/');
19
  }
20
  return (
21
- <div className="w-[1600px] max-w-full mx-auto flex flex-col space-y-4 items-center">
22
- <TopPrompt chat={chat} userId={userId} />
23
- <ChatInterface chat={chat} userId={userId} />
24
- </div>
 
 
25
  );
26
  }
 
4
  import { redirect } from 'next/navigation';
5
  import { revalidatePath } from 'next/cache';
6
  import TopPrompt from '@/components/chat/TopPrompt';
7
+ import { Provider } from 'jotai';
8
 
9
  interface ChatServerProps {
10
  chatId: string;
 
19
  redirect('/');
20
  }
21
  return (
22
+ <Provider>
23
+ <div className="w-[1600px] max-w-full mx-auto flex flex-col space-y-4 items-center">
24
+ <TopPrompt chat={chat} userId={userId} />
25
+ <ChatInterface chat={chat} userId={userId} />
26
+ </div>
27
+ </Provider>
28
  );
29
  }