Merge branch 'fix/deep-clone-data' into 'dev'

fix deep cloning bug where phases don't have their own children but store references

See merge request ics/sp/2025/n25b/pepperplus-ui!27
This commit was merged in pull request #27.
This commit is contained in:
Pim Hutting
2025-12-09 14:55:46 +00:00
3 changed files with 102 additions and 2 deletions

View File

@@ -92,7 +92,7 @@ function addNodeToFlow(nodeType: keyof typeof NodeTypes, position: XYPosition) {
id: id,
type: nodeType,
position,
data: {...defaultData}
data: JSON.parse(JSON.stringify(defaultData))
}
addNode(newNode);
}

View File

@@ -110,7 +110,6 @@ export function PhaseReduce(node: Node, nodes: Node[]) {
* @param isThisSource whether this instance of the node was the source in the connection, true = yes.
*/
export function PhaseConnects(thisNode: Node, otherNode: Node, isThisSource: boolean) {
console.log("Connect functionality called.")
const node = thisNode as PhaseNode
const data = node.data as PhaseNodeData
if (!isThisSource)