diff --git a/interactive-computational-graph/src/components/GraphContainer.tsx b/interactive-computational-graph/src/components/GraphContainer.tsx index 46d126f..ce3e3a3 100644 --- a/interactive-computational-graph/src/components/GraphContainer.tsx +++ b/interactive-computational-graph/src/components/GraphContainer.tsx @@ -67,11 +67,11 @@ import { addReactFlowNode, deselectLastSelectedNode, findRemovedEdges, + getLastSelectedNodeId, getNewReactFlowNodePosition, hideInputField, selectReactFlowNode, showInputFields, - updateLastSelectedNodeId, updateReactFlowNodeDarkMode, updateReactFlowNodeDerivatives, updateReactFlowNodeFValues, @@ -483,7 +483,7 @@ const GraphContainer: FunctionComponent = ({ const handleSelectionChange = useCallback( (params: OnSelectionChangeParams): void => { - setLastSelectedNodeId(updateLastSelectedNodeId(params.nodes)); + setLastSelectedNodeId(getLastSelectedNodeId(params.nodes)); }, [], ); diff --git a/interactive-computational-graph/src/features/ReactFlowController.ts b/interactive-computational-graph/src/features/ReactFlowController.ts index ebb1be3..a8fc416 100644 --- a/interactive-computational-graph/src/features/ReactFlowController.ts +++ b/interactive-computational-graph/src/features/ReactFlowController.ts @@ -226,7 +226,7 @@ const updateReactFlowNodeDarkMode = ( }); }; -const updateLastSelectedNodeId = (nodes: Node[]): string | null => { +const getLastSelectedNodeId = (nodes: Node[]): string | null => { const firstNode = nodes.find((node) => "id" in node) ?? null; if (firstNode === null) { return null; @@ -388,11 +388,11 @@ export { addReactFlowNode, deselectLastSelectedNode, findRemovedEdges, + getLastSelectedNodeId, getNewReactFlowNodePosition, hideInputField, selectReactFlowNode, showInputFields, - updateLastSelectedNodeId, updateReactFlowNodeDarkMode, updateReactFlowNodeDerivatives, updateReactFlowNodeFValues,