diff --git a/web/app/components/workflow/header/index.tsx b/web/app/components/workflow/header/index.tsx
index 9bc38f792f..c02717e7d2 100644
--- a/web/app/components/workflow/header/index.tsx
+++ b/web/app/components/workflow/header/index.tsx
@@ -8,7 +8,10 @@ import {
useStore,
useWorkflowStore,
} from '../store'
-import { useWorkflowRun } from '../hooks'
+import {
+ useNodesReadOnly,
+ useWorkflowRun,
+} from '../hooks'
import RunAndHistory from './run-and-history'
import EditingTitle from './editing-title'
import RunningTitle from './running-title'
@@ -24,7 +27,10 @@ const Header: FC = () => {
const workflowStore = useWorkflowStore()
const appDetail = useAppStore(s => s.appDetail)
const appSidebarExpand = useAppStore(s => s.appSidebarExpand)
- const runningStatus = useStore(s => s.runningStatus)
+ const {
+ nodesReadOnly,
+ getNodesReadOnly,
+ } = useNodesReadOnly()
const isRestoring = useStore(s => s.isRestoring)
const {
handleRunSetting,
@@ -32,11 +38,11 @@ const Header: FC = () => {
} = useWorkflowRun()
const handleShowFeatures = useCallback(() => {
- if (runningStatus)
+ if (getNodesReadOnly())
return
workflowStore.setState({ showFeaturesPanel: true })
- }, [runningStatus, workflowStore])
+ }, [getNodesReadOnly, workflowStore])
const handleGoBackToEdit = useCallback(() => {
handleRunSetting(true)
@@ -65,10 +71,10 @@ const Header: FC = () => {
)
}
{
- !runningStatus && !isRestoring &&
+ !nodesReadOnly && !isRestoring &&
}
{
- runningStatus && !isRestoring &&
+ nodesReadOnly && !isRestoring &&
}
{
isRestoring &&
@@ -78,7 +84,7 @@ const Header: FC = () => {
!isRestoring && (
{
- runningStatus && (
+ nodesReadOnly && (