Skip to content

Commit 0cc0be7

Browse files
committed
added defense in depth for renaming locked blocks
1 parent 6a1c52b commit 0cc0be7

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

apps/sim/hooks/use-collaborative-workflow.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,15 +1092,13 @@ export function useCollaborativeWorkflow() {
10921092
const previousStates: Record<string, boolean> = {}
10931093
const validIds: string[] = []
10941094

1095-
// For each ID, collect blocks and their children for undo/redo
10961095
for (const id of ids) {
10971096
const block = currentBlocks[id]
10981097
if (!block) continue
10991098

11001099
validIds.push(id)
11011100
previousStates[id] = block.locked ?? false
11021101

1103-
// If it's a loop or parallel, also capture children's previous states for undo/redo
11041102
if (block.type === 'loop' || block.type === 'parallel') {
11051103
Object.entries(currentBlocks).forEach(([blockId, b]) => {
11061104
if (b.data?.parentId === id) {
@@ -1145,7 +1143,6 @@ export function useCollaborativeWorkflow() {
11451143

11461144
if (edges.length === 0) return false
11471145

1148-
// Filter out invalid edges (e.g., edges targeting trigger blocks) and duplicates
11491146
const blocks = useWorkflowStore.getState().blocks
11501147
const currentEdges = useWorkflowStore.getState().edges
11511148
const validEdges = filterValidEdges(edges, blocks)

0 commit comments

Comments
 (0)