mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-28 00:08:21 -05:00
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.
This commit is contained in:
@@ -466,10 +466,11 @@ export const useWorkflowStore = create<WorkflowStore>()(
|
||||
currentParentId = parent.data?.parentId
|
||||
}
|
||||
|
||||
const { parentId: _removed, extent: _removedExtent, ...restData } = block.data || {}
|
||||
newBlocks[blockId] = {
|
||||
...block,
|
||||
position: { x: absoluteX, y: absoluteY },
|
||||
data: { ...block.data, parentId: undefined },
|
||||
data: Object.keys(restData).length > 0 ? restData : undefined,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user