fix: update setLastUsedChatSystemPrompt calls to use newHistoryId.id

This commit is contained in:
n4ze3m 2024-12-13 18:08:19 +05:30
parent dcd52ad6d5
commit 2b08786149

View File

@ -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 })
}
}
}