mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-09 16:38:19 +00:00
update apply diff
This commit is contained in:
@@ -36,12 +36,11 @@ export function useChatHistory(): UseChatHistory {
|
||||
void fetchChatList()
|
||||
}, [fetchChatList])
|
||||
|
||||
// 只新增消息
|
||||
const createConversation = useCallback(
|
||||
const createOrUpdateConversation = useCallback(
|
||||
async (id: string, messages: ChatMessage[]): Promise<void> => {
|
||||
const dbManager = await getManager()
|
||||
const conversationManager = dbManager.getConversationManager()
|
||||
await conversationManager.saveConversation(id, messages)
|
||||
await conversationManager.txCreateOrUpdateConversation(id, messages)
|
||||
},
|
||||
[getManager],
|
||||
)
|
||||
@@ -74,7 +73,7 @@ export function useChatHistory(): UseChatHistory {
|
||||
)
|
||||
|
||||
return {
|
||||
createOrUpdateConversation: createConversation,
|
||||
createOrUpdateConversation,
|
||||
deleteConversation,
|
||||
getChatMessagesById,
|
||||
updateConversationTitle,
|
||||
|
||||
Reference in New Issue
Block a user