summaryrefslogtreecommitdiff
path: root/org-roam-ui.el
diff options
context:
space:
mode:
Diffstat (limited to 'org-roam-ui.el')
-rw-r--r--org-roam-ui.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/org-roam-ui.el b/org-roam-ui.el
index fe0eb1b..655b643 100644
--- a/org-roam-ui.el
+++ b/org-roam-ui.el
@@ -144,7 +144,6 @@ This serves the web-build and API over HTTP."
(let* ((msg (json-parse-string (websocket-frame-text frame) :object-type 'alist))
(command (alist-get 'command msg))
(data (alist-get 'data msg)))
- (message "%s" (websocket-frame-text frame))
(cond ((string= command "open")
(org-roam-node-visit
(org-roam-populate (org-roam-node-create
@@ -155,6 +154,14 @@ This serves the web-build and API over HTTP."
(delete-file (alist-get 'file data))
(org-roam-db-sync)
(org-roam-ui--send-graphdata)))
+ ((string= command "create")
+
+ (progn
+ (if (and (fboundp #'orb-edit-note) (alist-get 'ROAM_REFS data))
+ (orb-edit-note (alist-get 'id data)))
+ (org-roam-capture-
+ :node (org-roam-node-create :title (alist-get 'title data))
+ :props '(:finalize find-file))))
(t (message "Something went wrong when receiving a message from Org-Roam-UI")))))
:on-close (lambda (_websocket)
(remove-hook 'after-save-hook #'org-roam-ui--on-save)