Skip to content

Commit 08bad4d

Browse files
committed
ack comments
1 parent 37dbfe3 commit 08bad4d

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,10 +2188,9 @@ const WorkflowContent = React.memo(() => {
21882188
selected: selectedIds.has(node.id),
21892189
}))
21902190
})
2191-
}, [derivedNodes, blocks, pendingSelection, clearPendingSelection, syncPanelWithSelection])
2191+
}, [derivedNodes, blocks, pendingSelection, clearPendingSelection])
21922192

21932193
// Phase 2: When displayNodes updates, check if pending zoom blocks are ready
2194-
// (Phase 1 is located earlier in the file where pendingZoomBlockIdsRef is defined)
21952194
useEffect(() => {
21962195
const pendingBlockIds = pendingZoomBlockIdsRef.current
21972196
if (!pendingBlockIds || pendingBlockIds.size === 0) {

apps/sim/stores/workflows/workflow/store.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,20 @@ export const useWorkflowStore = create<WorkflowStore>()(
615615
options?: { updateLastSaved?: boolean }
616616
) => {
617617
set((state) => {
618-
const nextBlocks = workflowState.blocks || {}
618+
const incomingBlocks = workflowState.blocks || {}
619+
620+
const nextBlocks: typeof incomingBlocks = {}
621+
for (const [id, block] of Object.entries(incomingBlocks)) {
622+
if (block.data?.parentId && !incomingBlocks[block.data.parentId]) {
623+
nextBlocks[id] = {
624+
...block,
625+
data: { ...block.data, parentId: undefined, extent: undefined },
626+
}
627+
} else {
628+
nextBlocks[id] = block
629+
}
630+
}
631+
619632
const nextEdges = filterValidEdges(workflowState.edges || [], nextBlocks)
620633
const nextLoops =
621634
Object.keys(workflowState.loops || {}).length > 0

0 commit comments

Comments
 (0)