summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--org-roam-ui.el5
-rw-r--r--pages/index.tsx1
2 files changed, 3 insertions, 3 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index 8f7cc56..b2886d2 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -139,13 +139,12 @@ This serves the web-build and API over HTTP."
(websocket-send-text oru-ws (json-encode `((type . "graphdata") (data . ,response))))))
(defun org-roam-ui--update-current-node ()
- (when (websocket-openp oru-ws)
+ (when (and (websocket-openp oru-ws) (org-roam-buffer-p))
(let* ((node (org-roam-id-at-point)))
- (unless (string-match-p (regexp-quote "Minibuf") (buffer-name (current-buffer)))
(unless (string= org-roam-ui--ws-current-node node)
(setq org-roam-ui--ws-current-node node)
(websocket-send-text oru-ws (json-encode `((type . "command") (data
-. ((commandName . "follow") (id . ,node)))))))))))
+. ((commandName . "follow") (id . ,node))))))))))
(defun org-roam-ui-show-node ()
"Open the current org-roam node in org-roam-ui."
diff --git a/pages/index.tsx b/pages/index.tsx
index 96d3ba8..8a9f39d 100644
--- a/pages/index.tsx
+++ b/pages/index.tsx
@@ -631,6 +631,7 @@ export const Graph = forwardRef(function (props: GraphProps, graphRef: any) {
d3VelocityDecay: physics.velocityDecay,
onNodeClick: (node: NodeObject, event: any) => {
+ event.preventDefault()
const isDoubleClick = event.timeStamp - lastNodeClickRef.current < 400
lastNodeClickRef.current = event.timeStamp