Skip to content

Commit

Permalink
refactor: Cleaner distinguishing of def-name node in onNodeClick
Browse files Browse the repository at this point in the history
This was made possible by recent changes to make `PrimerNode` a proper discriminated union.
  • Loading branch information
georgefst committed Mar 22, 2023
1 parent 9a63d46 commit 58c8c34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ const AppNoError = ({
<TreeReactFlow
{...(selection && { selection })}
onNodeClick={(_e, node) => {
if (!("nodeType" in node.data)) {
if (node.type == "primer-def-name") {
setSelection({
def: node.data.def,
});
Expand Down

0 comments on commit 58c8c34

Please sign in to comment.