From 8d390026ea9d7d7599fde56cd3f6effc2b063dab Mon Sep 17 00:00:00 2001 From: a7m-1st Date: Thu, 20 Nov 2025 17:41:00 +0300 Subject: [PATCH] fix: edit task not deleting history --- src/components/ChatBox/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/ChatBox/index.tsx b/src/components/ChatBox/index.tsx index 41c66f352..b193bd132 100644 --- a/src/components/ChatBox/index.tsx +++ b/src/components/ChatBox/index.tsx @@ -461,7 +461,13 @@ export default function ChatBox(): JSX.Element { chatStore.setAttaches(id, attachments); } chatStore.removeTask(taskId); - proxyFetchDelete(`/api/chat/history/${taskId}`); + const history_id = projectStore.getHistoryId(projectStore.activeProjectId); + try { + if(!history_id) throw new Error("No history ID found for the project"); + proxyFetchDelete(`/api/chat/history/${history_id}`); + } catch(error) { + console.error("Failed to delete chat history:", error); + } setMessage(question); };