diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index d8050d3..32b970e 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -239,6 +239,7 @@ export function Layout() { const item = await detaDB.chats.put({ description: "New Chat", + prompt: null, totalTokens: 0, createdAt: new Date().toISOString(), }, generateKey()) diff --git a/src/routes/ChatRoute.tsx b/src/routes/ChatRoute.tsx index 8c3754a..fdf23d2 100644 --- a/src/routes/ChatRoute.tsx +++ b/src/routes/ChatRoute.tsx @@ -66,8 +66,8 @@ export function ChatRoute() { const { chat, setChat } = useChat() useEffect(() => { - if (chat?.prompt) { - setPromptKey(chat.prompt) + if (chat) { + setPromptKey(chat.prompt ?? null) } }, [chat]);