fix: tool id (#13932)

This commit is contained in:
zxhlyh 2025-02-18 18:17:41 +08:00 • committed by GitHub
commit 3460c1dfbd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 53 additions and 25 deletions

View file

@ -58,6 +58,7 @@ import I18n from '@/context/i18n'
import { CollectionType } from '@/app/components/tools/types'
import { CUSTOM_ITERATION_START_NODE } from '@/app/components/workflow/nodes/iteration-start/constants'
import { useWorkflowConfig } from '@/service/use-workflow'
import { canFindTool } from '@/utils'
export const useIsChatMode = () => {
const appDetail = useAppStore(s => s.appDetail)
@ -608,11 +609,7 @@ export const useToolIcon = (data: Node['data']) => {
targetTools = customTools
else
targetTools = workflowTools
return targetTools.find((toolWithProvider) => {
return toolWithProvider.id === data.provider_id
|| toolWithProvider.id === `langgenius/${data.provider_id}/${data.provider_id}`
|| toolWithProvider.id === `langgenius/${data.provider_id}_tool/${data.provider_id}`
})?.icon
return targetTools.find(toolWithProvider => canFindTool(toolWithProvider.id, data.provider_id))?.icon
}
}, [data, buildInTools, customTools, workflowTools])