Skip to content

Commit 791b28e

Browse files
committed
fix: Fix errors after clicking edges
But we will remove the functionality to select edges soon
1 parent 1b9499d commit 791b28e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

graph.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,10 @@ function highlightNode(node) {
9595
// Swap out center/uncenter buttons
9696
const centerButton = document.getElementById("center_button");
9797
const uncenterButton = document.getElementById("uncenter_button");
98-
centerButton.classList.add("d-none");
99-
uncenterButton.classList.remove("d-none");
98+
if (centerButton) {
99+
centerButton.classList.add("d-none");
100+
uncenterButton.classList.remove("d-none");
101+
}
100102

101103
// Ignore the meta node
102104
meta_node.deselect();
@@ -222,8 +224,10 @@ function unhighlightNode(event, unselect) {
222224
// Swap out center/uncenter buttons
223225
const centerButton = document.getElementById("center_button");
224226
const uncenterButton = document.getElementById("uncenter_button");
225-
centerButton.classList.remove("d-none");
226-
uncenterButton.classList.add("d-none");
227+
if (centerButton) {
228+
centerButton.classList.remove("d-none");
229+
uncenterButton.classList.add("d-none");
230+
}
227231

228232
// Ignore the meta node
229233
meta_node.restore();

0 commit comments

Comments
 (0)