diff --git a/src/renderer/src/pages/home/Tabs/components/AssistantItem.tsx b/src/renderer/src/pages/home/Tabs/components/AssistantItem.tsx index 6e18036245..3d7b920f89 100644 --- a/src/renderer/src/pages/home/Tabs/components/AssistantItem.tsx +++ b/src/renderer/src/pages/home/Tabs/components/AssistantItem.tsx @@ -1,4 +1,5 @@ import { + CheckOutlined, DeleteOutlined, EditOutlined, MinusCircleOutlined, @@ -185,10 +186,9 @@ const handleTagOperation = ( updateAssistants: (assistants: Assistant[]) => void ) => { if (assistant.tags?.includes(tag)) { - updateAssistants(assistants.map((a) => (a.id === assistant.id ? { ...a, tags: [] } : a))) - } else { - updateAssistants(assistants.map((a) => (a.id === assistant.id ? { ...a, tags: [tag] } : a))) + return } + updateAssistants(assistants.map((a) => (a.id === assistant.id ? { ...a, tags: [tag] } : a))) } // 提取创建菜单项的函数 @@ -202,8 +202,7 @@ const createTagMenuItems = ( const items: MenuProps['items'] = [ ...allTags.map((tag) => ({ label: tag, - icon: assistant.tags?.includes(tag) ? : , - danger: assistant.tags?.includes(tag), + icon: assistant.tags?.includes(tag) ? : , key: `all-tag-${tag}`, onClick: () => handleTagOperation(tag, assistant, assistants, updateAssistants) }))