From 2b087861497e7707d3b3ea0261fe6b0fdcb63001 Mon Sep 17 00:00:00 2001 From: n4ze3m Date: Fri, 13 Dec 2024 18:08:19 +0530 Subject: [PATCH] fix: update setLastUsedChatSystemPrompt calls to use newHistoryId.id --- src/hooks/chat-helper/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }) } } }