mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-23 01:50:13 +08:00
fix: cannot remove assistat tag
This commit is contained in:
parent
8c617872e0
commit
3350f58422
@ -185,10 +185,10 @@ const handleTagOperation = (
|
|||||||
assistants: Assistant[],
|
assistants: Assistant[],
|
||||||
updateAssistants: (assistants: Assistant[]) => void
|
updateAssistants: (assistants: Assistant[]) => void
|
||||||
) => {
|
) => {
|
||||||
if (assistant.tags?.includes(tag)) {
|
const removeTag = () => updateAssistants(assistants.map((a) => (a.id === assistant.id ? { ...a, tags: [] } : a)))
|
||||||
return
|
const addTag = () => updateAssistants(assistants.map((a) => (a.id === assistant.id ? { ...a, tags: [tag] } : a)))
|
||||||
}
|
const hasTag = assistant.tags?.includes(tag)
|
||||||
updateAssistants(assistants.map((a) => (a.id === assistant.id ? { ...a, tags: [tag] } : a)))
|
hasTag ? removeTag() : addTag()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提取创建菜单项的函数
|
// 提取创建菜单项的函数
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user