From 0f4c025869cc5eaae38c270e8cd8b37457513eff Mon Sep 17 00:00:00 2001
From: "Thomas F. K. Jorna" <thomasfkjorna@gmail.com>
Date: Thu, 29 Jul 2021 17:40:32 +0200
Subject: zooommm

---
 pages/index.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'pages/index.tsx')

diff --git a/pages/index.tsx b/pages/index.tsx
index d1c9cf2..2b1ba62 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -132,7 +132,6 @@ export function GraphPage() {
   const graphRef = useRef<any>(null)
 
   useEffect(() => {
-    const fg = graphRef.current
     const socket = new ReconnectingWebSocket('ws://localhost:35903')
     socket.addEventListener('open', (event) => {
       console.log('Connection with Emacs established')
@@ -157,6 +156,7 @@ export function GraphPage() {
                   ...links.flatMap((link) => [link.source, link.target]),
                 ].map((nodeId) => [nodeId, {}]),
               )
+              const fg = graphRef.current
               fg.zoomToFit(2000, 200, (node: OrgRoamNode) => nodes[node.id!])
             }
             case 'toggle': {
-- 
cgit v1.2.3

