Skip to content

Commit a826b97

Browse files
waleedlatif1claude
andcommitted
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>
1 parent 813ec9b commit a826b97

File tree

1 file changed

+1
-5
lines changed
  • apps/sim/app/workspace/[workspaceId]/w/[workflowId]

1 file changed

+1
-5
lines changed

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ import {
5757
estimateBlockDimensions,
5858
filterProtectedBlocks,
5959
getClampedPositionForNode,
60-
hasProtectedBlocks,
6160
isBlockProtected,
6261
isEdgeProtected,
6362
isInEditableElement,
@@ -3606,10 +3605,7 @@ const WorkflowContent = React.memo(() => {
36063605
canRunFromBlock={runFromBlockState.canRun}
36073606
disableEdit={
36083607
!effectivePermissions.canEdit ||
3609-
hasProtectedBlocks(
3610-
contextMenuBlocks.map((b) => b.id),
3611-
blocks
3612-
)
3608+
contextMenuBlocks.some((b) => b.locked || b.isParentLocked)
36133609
}
36143610
userCanEdit={effectivePermissions.canEdit}
36153611
isExecuting={isExecuting}

0 commit comments

Comments
 (0)