mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-16 13:55:54 +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 buildInTools = useStore(s => s.buildInTools)
|
||||||
const customTools = useStore(s => s.customTools)
|
const customTools = useStore(s => s.customTools)
|
||||||
const workflowTools = useStore(s => s.workflowTools)
|
const workflowTools = useStore(s => s.workflowTools)
|
||||||
|
const mcpTools = useStore(s => s.mcpTools)
|
||||||
|
|
||||||
const toolIcon = useMemo(() => {
|
const toolIcon = useMemo(() => {
|
||||||
if (data.type === BlockEnum.Tool) {
|
if (data.type === BlockEnum.Tool) {
|
||||||
let targetTools = buildInTools
|
let targetTools = buildInTools
|
||||||
@ -511,11 +513,13 @@ export const useToolIcon = (data: Node['data']) => {
|
|||||||
targetTools = buildInTools
|
targetTools = buildInTools
|
||||||
else if (data.provider_type === CollectionType.custom)
|
else if (data.provider_type === CollectionType.custom)
|
||||||
targetTools = customTools
|
targetTools = customTools
|
||||||
|
else if (data.provider_type === CollectionType.mcp)
|
||||||
|
targetTools = mcpTools
|
||||||
else
|
else
|
||||||
targetTools = workflowTools
|
targetTools = workflowTools
|
||||||
return targetTools.find(toolWithProvider => canFindTool(toolWithProvider.id, data.provider_id))?.icon
|
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
|
return toolIcon
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user