From f495a9499c549d92d64ee3a2e50a239ea769c609 Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <hello@tefkah.com>
Date: Thu, 7 Oct 2021 02:05:58 +0200
Subject: fix: make daily toggle useful

---
 pages/index.tsx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'pages/index.tsx')

diff --git a/pages/index.tsx b/pages/index.tsx
index a40f942..c180ad9 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -361,7 +361,6 @@ export function GraphPage() {
           return updateGraphData(message.data)
         case 'variables':
           variablesRef.current = message.data
-          console.log(message.data)
           return
         case 'theme':
           return setEmacsTheme(['custom', message.data])
@@ -626,7 +625,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
           hiddenNodeIdsRef.current = { ...hiddenNodeIdsRef.current, [node.id]: node }
           return false
         }
-        if (filter.filelessCites && node.properties.FILELESS) {
+        if (filter.filelessCites && node?.properties?.FILELESS) {
           hiddenNodeIdsRef.current = { ...hiddenNodeIdsRef.current, [node.id]: node }
           return false
         }
@@ -635,7 +634,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
           return false
         }
 
-        if (filter.dailies && dailyDir?.length !== 0 && node.file.includes(dailyDir)) {
+        if (filter.dailies && dailyDir && node.file?.includes(dailyDir)) {
           hiddenNodeIdsRef.current = { ...hiddenNodeIdsRef.current, [node.id]: node }
           return false
         }
-- 
cgit v1.2.3

