From 36ad7842512e6d76c5561fda2d2b5f17793b703d Mon Sep 17 00:00:00 2001 From: zhsama Date: Tue, 11 Nov 2025 20:00:56 +0800 Subject: [PATCH] feat(workflow-header): add conditional logic to disable publish and refresh actions based on workflow node presence --- .../components/workflow-header/features-trigger.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx b/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx index 47ec60d7ad..d229006177 100644 --- a/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx +++ b/web/app/components/workflow-app/components/workflow-header/features-trigger.tsx @@ -56,6 +56,7 @@ const FeaturesTrigger = () => { const lastPublishedHasUserInput = useStore(s => s.lastPublishedHasUserInput) const nodes = useNodes() + const hasWorkflowNodes = nodes.length > 0 const startNode = nodes.find(node => node.data.type === BlockEnum.Start) const startVariables = (startNode as Node)?.data?.variables const edges = useEdges() @@ -185,7 +186,7 @@ const FeaturesTrigger = () => { {...{ publishedAt, draftUpdatedAt, - disabled: nodesReadOnly, + disabled: nodesReadOnly || !hasWorkflowNodes, toolPublished, inputs: variables, onRefreshData: handleToolConfigureUpdate, @@ -195,6 +196,7 @@ const FeaturesTrigger = () => { crossAxisOffset: 4, missingStartNode: !startNode, hasTriggerNode, + publishDisabled: !hasWorkflowNodes, }} />