mirror of
https://github.com/simstudioai/sim.git
synced 2026-02-01 02:05:18 -05:00
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:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user