fix: update refresh logic for plugin list to avoid redundant request and fix model provider list update issue in settings (#14152)
This commit is contained in:
@@ -23,17 +23,15 @@ const useRefreshPluginList = () => {
|
||||
// installed list
|
||||
invalidateInstalledPluginList()
|
||||
|
||||
if (!manifest) return
|
||||
|
||||
// tool page, tool select
|
||||
if (PluginType.tool.includes(manifest.category) || refreshAllType) {
|
||||
if ((manifest && PluginType.tool.includes(manifest.category)) || refreshAllType) {
|
||||
invalidateAllToolProviders()
|
||||
invalidateAllBuiltInTools()
|
||||
// TODO: update suggested tools. It's a function in hook useMarketplacePlugins,handleUpdatePlugins
|
||||
}
|
||||
|
||||
// model select
|
||||
if (PluginType.model.includes(manifest.category) || refreshAllType) {
|
||||
if ((manifest && PluginType.model.includes(manifest.category)) || refreshAllType) {
|
||||
refreshModelProviders()
|
||||
refetchLLMModelList()
|
||||
refetchEmbeddingModelList()
|
||||
@@ -41,7 +39,7 @@ const useRefreshPluginList = () => {
|
||||
}
|
||||
|
||||
// agent select
|
||||
if (PluginType.agent.includes(manifest.category) || refreshAllType)
|
||||
if ((manifest && PluginType.agent.includes(manifest.category)) || refreshAllType)
|
||||
invalidateStrategyProviders()
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user