瀏覽代碼

fix: refresh datasource list after install datasource (#25949)

tags/1.9.0
zxhlyh 1 月之前
父節點
當前提交
6453fc4973
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 5 行新增0 行删除
  1. 5
    0
      web/app/components/plugins/install-plugin/hooks/use-refresh-plugin-list.tsx

+ 5
- 0
web/app/components/plugins/install-plugin/hooks/use-refresh-plugin-list.tsx 查看文件

@@ -6,6 +6,7 @@ import { useInvalidateAllBuiltInTools, useInvalidateAllToolProviders } from '@/s
import { useInvalidateStrategyProviders } from '@/service/use-strategy'
import type { Plugin, PluginDeclaration, PluginManifestInMarket } from '../../types'
import { PluginType } from '../../types'
import { useInvalidDataSourceList } from '@/service/use-pipeline'

const useRefreshPluginList = () => {
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
@@ -16,6 +17,7 @@ const useRefreshPluginList = () => {

const invalidateAllToolProviders = useInvalidateAllToolProviders()
const invalidateAllBuiltInTools = useInvalidateAllBuiltInTools()
const invalidateAllDataSources = useInvalidDataSourceList()

const invalidateStrategyProviders = useInvalidateStrategyProviders()
return {
@@ -30,6 +32,9 @@ const useRefreshPluginList = () => {
// TODO: update suggested tools. It's a function in hook useMarketplacePlugins,handleUpdatePlugins
}

if ((manifest && PluginType.datasource.includes(manifest.category)) || refreshAllType)
invalidateAllDataSources()

// model select
if ((manifest && PluginType.model.includes(manifest.category)) || refreshAllType) {
refreshModelProviders()

Loading…
取消
儲存