mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 11:15:57 +08:00
fix: tools icon
This commit is contained in:
parent
d1983e4d06
commit
a77e7ab177
@ -504,6 +504,8 @@ export const useToolIcon = (data: Node['data']) => {
|
||||
const buildInTools = useStore(s => s.buildInTools)
|
||||
const customTools = useStore(s => s.customTools)
|
||||
const workflowTools = useStore(s => s.workflowTools)
|
||||
const mcpTools = useStore(s => s.mcpTools)
|
||||
|
||||
const toolIcon = useMemo(() => {
|
||||
if (data.type === BlockEnum.Tool) {
|
||||
let targetTools = buildInTools
|
||||
@ -511,11 +513,13 @@ export const useToolIcon = (data: Node['data']) => {
|
||||
targetTools = buildInTools
|
||||
else if (data.provider_type === CollectionType.custom)
|
||||
targetTools = customTools
|
||||
else if (data.provider_type === CollectionType.mcp)
|
||||
targetTools = mcpTools
|
||||
else
|
||||
targetTools = workflowTools
|
||||
return targetTools.find(toolWithProvider => canFindTool(toolWithProvider.id, data.provider_id))?.icon
|
||||
}
|
||||
}, [data, buildInTools, customTools, workflowTools])
|
||||
}, [data.type, data.provider_type, data.provider_id, buildInTools, customTools, mcpTools, workflowTools])
|
||||
|
||||
return toolIcon
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user