refactor(workflow): use pre-computed lock state from contextMenuBlocks

contextMenuBlocks already has locked and isParentLocked properties
computed in use-canvas-context-menu.ts, so there's no need to look
up blocks again via hasProtectedBlocks.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
waleed
2026-01-31 21:15:33 -08:00
parent 813ec9b758
commit a826b9785d

View File

@@ -57,7 +57,6 @@ import {
estimateBlockDimensions,
filterProtectedBlocks,
getClampedPositionForNode,
hasProtectedBlocks,
isBlockProtected,
isEdgeProtected,
isInEditableElement,
@@ -3606,10 +3605,7 @@ const WorkflowContent = React.memo(() => {
canRunFromBlock={runFromBlockState.canRun}
disableEdit={
!effectivePermissions.canEdit ||
hasProtectedBlocks(
contextMenuBlocks.map((b) => b.id),
blocks
)
contextMenuBlocks.some((b) => b.locked || b.isParentLocked)
}
userCanEdit={effectivePermissions.canEdit}
isExecuting={isExecuting}