From 58c8c343beee03dd0abf193bbf0a803943aae72a Mon Sep 17 00:00:00 2001 From: George Thomas Date: Tue, 21 Mar 2023 20:19:22 +0000 Subject: [PATCH] refactor: Cleaner distinguishing of def-name node in `onNodeClick` This was made possible by recent changes to make `PrimerNode` a proper discriminated union. --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index 8b679ce2..00927c2d 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -248,7 +248,7 @@ const AppNoError = ({ { - if (!("nodeType" in node.data)) { + if (node.type == "primer-def-name") { setSelection({ def: node.data.def, });