mirror of https://github.com/langgenius/dify.git
fix: refresh datasource list after install datasource (#25949)
This commit is contained in:
parent
f62f926537
commit
6453fc4973
|
|
@ -6,6 +6,7 @@ import { useInvalidateAllBuiltInTools, useInvalidateAllToolProviders } from '@/s
|
||||||
import { useInvalidateStrategyProviders } from '@/service/use-strategy'
|
import { useInvalidateStrategyProviders } from '@/service/use-strategy'
|
||||||
import type { Plugin, PluginDeclaration, PluginManifestInMarket } from '../../types'
|
import type { Plugin, PluginDeclaration, PluginManifestInMarket } from '../../types'
|
||||||
import { PluginType } from '../../types'
|
import { PluginType } from '../../types'
|
||||||
|
import { useInvalidDataSourceList } from '@/service/use-pipeline'
|
||||||
|
|
||||||
const useRefreshPluginList = () => {
|
const useRefreshPluginList = () => {
|
||||||
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
|
const invalidateInstalledPluginList = useInvalidateInstalledPluginList()
|
||||||
|
|
@ -16,6 +17,7 @@ const useRefreshPluginList = () => {
|
||||||
|
|
||||||
const invalidateAllToolProviders = useInvalidateAllToolProviders()
|
const invalidateAllToolProviders = useInvalidateAllToolProviders()
|
||||||
const invalidateAllBuiltInTools = useInvalidateAllBuiltInTools()
|
const invalidateAllBuiltInTools = useInvalidateAllBuiltInTools()
|
||||||
|
const invalidateAllDataSources = useInvalidDataSourceList()
|
||||||
|
|
||||||
const invalidateStrategyProviders = useInvalidateStrategyProviders()
|
const invalidateStrategyProviders = useInvalidateStrategyProviders()
|
||||||
return {
|
return {
|
||||||
|
|
@ -30,6 +32,9 @@ const useRefreshPluginList = () => {
|
||||||
// TODO: update suggested tools. It's a function in hook useMarketplacePlugins,handleUpdatePlugins
|
// TODO: update suggested tools. It's a function in hook useMarketplacePlugins,handleUpdatePlugins
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((manifest && PluginType.datasource.includes(manifest.category)) || refreshAllType)
|
||||||
|
invalidateAllDataSources()
|
||||||
|
|
||||||
// model select
|
// model select
|
||||||
if ((manifest && PluginType.model.includes(manifest.category)) || refreshAllType) {
|
if ((manifest && PluginType.model.includes(manifest.category)) || refreshAllType) {
|
||||||
refreshModelProviders()
|
refreshModelProviders()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue