diff --git a/web/app/components/plugins/plugin-detail-panel/action-list.tsx b/web/app/components/plugins/plugin-detail-panel/action-list.tsx index 13027803d2..c90f1ffb0d 100644 --- a/web/app/components/plugins/plugin-detail-panel/action-list.tsx +++ b/web/app/components/plugins/plugin-detail-panel/action-list.tsx @@ -1,4 +1,4 @@ -import React, { useMemo, useState } from 'react' +import React, { useState } from 'react' import useSWR from 'swr' import { useTranslation } from 'react-i18next' import { usePluginPageContext } from '@/app/components/plugins/plugin-page/context' @@ -10,6 +10,7 @@ import ToolItem from '@/app/components/tools/provider/tool-item' import ConfigCredential from '@/app/components/tools/setting/build-in/config-credentials' import { fetchBuiltInToolList, + fetchCollectionDetail, removeBuiltInToolCredential, updateBuiltInToolCredential, } from '@/service/tools' @@ -18,12 +19,10 @@ const ActionList = () => { const { t } = useTranslation() const { isCurrentWorkspaceManager } = useAppContext() const currentPluginDetail = usePluginPageContext(v => v.currentPluginDetail) - const providerDeclaration = useMemo(() => { - return { - ...currentPluginDetail.declaration.tool.identity, - name: `${currentPluginDetail.plugin_id}/${currentPluginDetail.name}`, - } - }, [currentPluginDetail.declaration.tool.identity, currentPluginDetail.name, currentPluginDetail.plugin_id]) + const { data: provider } = useSWR( + `builtin/${currentPluginDetail.plugin_id}/${currentPluginDetail.name}`, + fetchCollectionDetail, + ) const { data } = useSWR( `${currentPluginDetail.plugin_id}/${currentPluginDetail.name}`, fetchBuiltInToolList, @@ -33,7 +32,7 @@ const ActionList = () => { const handleCredentialSettingUpdate = () => {} - if (!data) + if (!data || !provider) return null return ( @@ -41,7 +40,7 @@ const ActionList = () => {