From ed54bd5121342f154227b5794232ddba6cdb3c27 Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 3 Jul 2025 16:43:11 +0800 Subject: [PATCH] fix: not search plugin if marketplace enabled (#21880) --- .../components/workflow/block-selector/all-tools.tsx | 2 +- .../nodes/_base/components/agent-strategy-selector.tsx | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web/app/components/workflow/block-selector/all-tools.tsx b/web/app/components/workflow/block-selector/all-tools.tsx index 36831aee3..e57a6bd3f 100644 --- a/web/app/components/workflow/block-selector/all-tools.tsx +++ b/web/app/components/workflow/block-selector/all-tools.tsx @@ -90,7 +90,7 @@ const AllTools = ({ const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures) useEffect(() => { - if (enable_marketplace) return + if (!enable_marketplace) return if (searchText || tags.length > 0) { fetchPlugins({ query: searchText, diff --git a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx index dd6a1c6a2..f262ae7e3 100644 --- a/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx +++ b/web/app/components/workflow/nodes/_base/components/agent-strategy-selector.tsx @@ -22,6 +22,7 @@ import type { ListRef } from '@/app/components/workflow/block-selector/market-pl import PluginList, { type ListProps } from '@/app/components/workflow/block-selector/market-place-plugin/list' import { useMarketplacePlugins } from '@/app/components/plugins/marketplace/hooks' import { ToolTipContent } from '@/app/components/base/tooltip/content' +import { useGlobalPublicStore } from '@/context/global-public-context' const DEFAULT_TAGS: ListProps['tags'] = [] @@ -131,7 +132,10 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) => plugins: notInstalledPlugins = [], } = useMarketplacePlugins() + const { enable_marketplace } = useGlobalPublicStore(s => s.systemFeatures) + useEffect(() => { + if (!enable_marketplace) return if (query) { fetchPlugins({ query, @@ -158,7 +162,7 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) => alt='icon' />}

{value?.agent_strategy_label || t('workflow.nodes.agent.strategy.selectTip')}

@@ -215,7 +219,8 @@ export const AgentStrategySelector = memo((props: AgentStrategySelectorProps) => }} className='h-full max-h-full max-w-none overflow-y-auto' indexBarClassName='top-0 xl:top-36' showWorkflowEmpty={false} hasSearchText={false} /> - tags={DEFAULT_TAGS} disableMaxWidth /> + }