Skip to content

Commit 503f676

Browse files
committed
fix(store): clear extent property when orphaning blocks
When a block's parent is removed, properly clear both parentId and extent properties from block.data, matching the pattern used in batchUpdateBlocksWithParent.
1 parent f2ca90a commit 503f676

File tree

1 file changed

+2
-1
lines changed
  • apps/sim/stores/workflows/workflow

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,11 @@ export const useWorkflowStore = create<WorkflowStore>()(
466466
currentParentId = parent.data?.parentId
467467
}
468468

469+
const { parentId: _removed, extent: _removedExtent, ...restData } = block.data || {}
469470
newBlocks[blockId] = {
470471
...block,
471472
position: { x: absoluteX, y: absoluteY },
472-
data: { ...block.data, parentId: undefined },
473+
data: Object.keys(restData).length > 0 ? restData : undefined,
473474
}
474475
}
475476
})

0 commit comments

Comments
 (0)