diff --git a/web/app/components/tools/provider-list.tsx b/web/app/components/tools/provider-list.tsx index 611d895780..08a4aa0b5d 100644 --- a/web/app/components/tools/provider-list.tsx +++ b/web/app/components/tools/provider-list.tsx @@ -17,11 +17,10 @@ import CardMoreInfo from '@/app/components/plugins/card/card-more-info' import PluginDetailPanel from '@/app/components/plugins/plugin-detail-panel' import MCPList from './mcp' import { useAllToolProviders } from '@/service/use-tools' -import { useInvalidateInstalledPluginList, usePluginDeclarationFromMarketPlace } from '@/service/use-plugins' +import { useCheckInstalled, useInvalidateInstalledPluginList } from '@/service/use-plugins' import { useGlobalPublicStore } from '@/context/global-public-context' import { ToolTypeEnum } from '../workflow/block-selector/types' import { useMarketplace } from './marketplace/hooks' -import type { PluginDetail } from '@/app/components/plugins/types' const getToolType = (type: string) => { switch (type) { @@ -78,18 +77,14 @@ const ProviderList = () => { const currentProvider = useMemo(() => { return filteredCollectionList.find(collection => collection.id === currentProviderId) }, [currentProviderId, filteredCollectionList]) - const { data: pluginDetail } = usePluginDeclarationFromMarketPlace(currentProvider?.plugin_unique_identifier || '') + const { data: checkedInstalledData } = useCheckInstalled({ + pluginIds: currentProvider?.plugin_id ? [currentProvider.plugin_id] : [], + enabled: !!currentProvider?.plugin_id, + }) const invalidateInstalledPluginList = useInvalidateInstalledPluginList() const currentPluginDetail = useMemo(() => { - if (!pluginDetail) return - const detail = { - plugin_id: currentProvider?.plugin_id, - plugin_unique_identifier: currentProvider?.plugin_unique_identifier, - declaration: pluginDetail?.manifest, - tenant_id: currentProvider?.tenant_id, - } - return detail as PluginDetail - }, [currentProvider, pluginDetail]) + return checkedInstalledData?.plugins?.[0] + }, [checkedInstalledData]) const toolListTailRef = useRef(null) const showMarketplacePanel = useCallback(() => { diff --git a/web/app/components/tools/types.ts b/web/app/components/tools/types.ts index 381b864170..93b15b0533 100644 --- a/web/app/components/tools/types.ts +++ b/web/app/components/tools/types.ts @@ -53,8 +53,6 @@ export type Collection = { allow_delete: boolean labels: string[] plugin_id?: string - plugin_unique_identifier?: string - tenant_id?: string letter?: string // MCP Server server_url?: string