Skip to content

Commit 58c8c34

Browse files
committed
refactor: Cleaner distinguishing of def-name node in onNodeClick
This was made possible by recent changes to make `PrimerNode` a proper discriminated union.
1 parent 9a63d46 commit 58c8c34

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ const AppNoError = ({
248248
<TreeReactFlow
249249
{...(selection && { selection })}
250250
onNodeClick={(_e, node) => {
251-
if (!("nodeType" in node.data)) {
251+
if (node.type == "primer-def-name") {
252252
setSelection({
253253
def: node.data.def,
254254
});

0 commit comments

Comments
 (0)