From 43ff4c5ce996875330b18e1826da6773a868054c Mon Sep 17 00:00:00 2001 From: mdshamoon Date: Sun, 24 Dec 2023 01:52:02 +0530 Subject: [PATCH] fix error in router add --- src/store/thunks.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/store/thunks.ts b/src/store/thunks.ts index d8eea9c95..d99a44c8e 100644 --- a/src/store/thunks.ts +++ b/src/store/thunks.ts @@ -1023,6 +1023,7 @@ export const onUpdateRouter = (renderNode: RenderNode) => ( ); } + renderNode.node = mutators.uniquifyNode(renderNode.node); // didn't recognize that action, let's add a new router node // if we are appendeng in, see if we need to route through const switchRouter = getSwitchRouter(renderNode.node); @@ -1035,12 +1036,17 @@ export const onUpdateRouter = (renderNode: RenderNode) => ( ); exitToUpdate.destination_uuid = originalNode.node.exits[0].destination_uuid; + if (exitToUpdate.destination_uuid) { + updated[exitToUpdate.destination_uuid].inboundConnections = { + [exitToUpdate.uuid]: renderNode.node.uuid + }; + } } renderNode.inboundConnections = { [originalNode.node.exits[0].uuid]: originalNode.node.uuid }; - renderNode.node = mutators.uniquifyNode(renderNode.node); + renderNode.ui.position.top += NODE_SPACING; updated = mutators.mergeNode(updated, renderNode); } else {