mirror of
https://github.com/deiucanta/chatpad.git
synced 2026-03-11 09:04:31 +00:00
fix: prompt from previous chat being used for new one
This commit is contained in:
parent
cee5664bc7
commit
d4e6e53279
2 changed files with 3 additions and 2 deletions
|
|
@ -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())
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue