summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Rogovoy <[email protected]>2021-07-30 10:00:50 +0300
committerKirill Rogovoy <[email protected]>2021-07-30 10:00:50 +0300
commit8ed19d4e9a29aa94192aa68813648fe607d005af (patch)
tree493f9664dc8824fdae125f8eadd7722b57cdf353
parente61f1e124f052e2317385b48f0b474175f685378 (diff)
Fix node following breaking on minibuffer
-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