From 0b243a18ebef35cbf7fc14cb5b23e86c8a4a245f Mon Sep 17 00:00:00 2001 From: puzhen <1303385763@qq.com> Date: Wed, 22 Oct 2025 22:43:15 +0100 Subject: [PATCH] chore --- src/components/ChatBox/TaskCard.tsx | 9 +++++---- src/pages/Dashboard/Browser.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/ChatBox/TaskCard.tsx b/src/components/ChatBox/TaskCard.tsx index 03a85f8a..c25d15f3 100644 --- a/src/components/ChatBox/TaskCard.tsx +++ b/src/components/ChatBox/TaskCard.tsx @@ -333,14 +333,15 @@ export function TaskCard({ if (task.agent) { // Switch to the chatStore that owns this task card (for multi-turn conversations) if (chatId && projectStore.activeProjectId) { + const activeProjectId = projectStore.activeProjectId; const activeChatStore = projectStore.getActiveChatStore(); - const currentChatId = activeChatStore ? Object.keys(projectStore.projects[projectStore.activeProjectId].chatStores).find( - id => projectStore.projects[projectStore.activeProjectId].chatStores[id] === activeChatStore + const currentChatId = activeChatStore ? Object.keys(projectStore.projects[activeProjectId].chatStores).find( + id => projectStore.projects[activeProjectId].chatStores[id] === activeChatStore ) : null; - + // Only switch if this is a different chat if (currentChatId !== chatId) { - projectStore.setActiveChatStore(projectStore.activeProjectId, chatId); + projectStore.setActiveChatStore(activeProjectId, chatId); } } diff --git a/src/pages/Dashboard/Browser.tsx b/src/pages/Dashboard/Browser.tsx index 4b83f0c7..37101c25 100644 --- a/src/pages/Dashboard/Browser.tsx +++ b/src/pages/Dashboard/Browser.tsx @@ -272,7 +272,7 @@ export default function Browser() { {cookieDomains.length > 0 && (