fix: dont show anything in pane if more than one item is selected

This commit is contained in:
Jan-Henrik Bruhn 2025-10-10 19:43:54 +02:00
parent 79edc902c5
commit 8d8ff2d200

View file

@ -189,13 +189,13 @@ const GraphEditor = ({ onNodeSelect, onEdgeSelect }: GraphEditorProps) => {
edges: Edge[]; edges: Edge[];
}) => { }) => {
// If a node is selected, notify parent // If a node is selected, notify parent
if (selectedNodes.length > 0) { if (selectedNodes.length == 1) {
const selectedNode = selectedNodes[0] as Actor; const selectedNode = selectedNodes[0] as Actor;
onNodeSelect(selectedNode); onNodeSelect(selectedNode);
// Don't call onEdgeSelect - parent will handle clearing edge selection // Don't call onEdgeSelect - parent will handle clearing edge selection
} }
// If an edge is selected, notify parent // If an edge is selected, notify parent
else if (selectedEdges.length > 0) { else if (selectedEdges.length == 1) {
const selectedEdge = selectedEdges[0] as Relation; const selectedEdge = selectedEdges[0] as Relation;
onEdgeSelect(selectedEdge); onEdgeSelect(selectedEdge);
// Don't call onNodeSelect - parent will handle clearing node selection // Don't call onNodeSelect - parent will handle clearing node selection