mirror of
https://github.com/eigent-ai/eigent.git
synced 2026-05-16 11:19:58 +00:00
Update TaskCard.tsx
This commit is contained in:
parent
d18cc9f1fb
commit
2bb4bf877b
1 changed files with 11 additions and 21 deletions
|
|
@ -332,27 +332,17 @@ export function TaskCard({
|
|||
onClick={() => {
|
||||
if (task.agent) {
|
||||
// Switch to the chatStore that owns this task card (for multi-turn conversations)
|
||||
if (chatId) {
|
||||
const activeProjectId = projectStore.activeProjectId;
|
||||
const activeChatStore = projectStore.getActiveChatStore();
|
||||
const project = activeProjectId
|
||||
? projectStore.projects?.[activeProjectId]
|
||||
: undefined;
|
||||
|
||||
if (activeChatStore && project?.chatStores) {
|
||||
const currentChatId = Object.keys(project.chatStores).find(
|
||||
(id) => project.chatStores[id] === activeChatStore
|
||||
) ?? null;
|
||||
|
||||
// Only switch if this is a different chat
|
||||
if (activeProjectId && currentChatId !== chatId) {
|
||||
projectStore.setActiveChatStore(activeProjectId, chatId);
|
||||
}
|
||||
} else if (activeProjectId) {
|
||||
// If no active chat store, set based on this task
|
||||
projectStore.setActiveChatStore(activeProjectId, chatId);
|
||||
}
|
||||
}
|
||||
if (chatId && 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
|
||||
) : null;
|
||||
|
||||
// Only switch if this is a different chat
|
||||
if (currentChatId !== chatId) {
|
||||
projectStore.setActiveChatStore(projectStore.activeProjectId, chatId);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the active workspace and agent
|
||||
chatStore.setActiveWorkSpace(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue