diff --git a/src/hooks/chat-helper/index.ts b/src/hooks/chat-helper/index.ts index 0fe65c4..3404c81 100644 --- a/src/hooks/chat-helper/index.ts +++ b/src/hooks/chat-helper/index.ts @@ -108,7 +108,7 @@ export const saveMessageOnError = async ({ setHistoryId(newHistoryId.id) await setLastUsedChatModel(newHistoryId.id, selectedModel) if (prompt_id || prompt_content) { - await setLastUsedChatSystemPrompt(historyId, { prompt_content, prompt_id }) + await setLastUsedChatSystemPrompt(newHistoryId.id, { prompt_content, prompt_id }) } } @@ -203,7 +203,7 @@ export const saveMessageOnSuccess = async ({ setHistoryId(newHistoryId.id) await setLastUsedChatModel(newHistoryId.id, selectedModel!) if (prompt_id || prompt_content) { - await setLastUsedChatSystemPrompt(historyId, { prompt_content, prompt_id }) + await setLastUsedChatSystemPrompt(newHistoryId.id, { prompt_content, prompt_id }) } } }