File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ This serves the web-build and API over HTTP."
179179 :group 'org-roam-ui
180180 :init-value nil
181181 (cond
182- (org-roam-ui-mode
182+ (( and org-roam-ui-mode ( not (org-roam-ui-server-runningp)))
183183 ; ;; check if the default keywords actually exist on `orb-preformat-keywords'
184184 ; ;; else add them
185185 (setq-local httpd-port org-roam-ui-port)
@@ -201,6 +201,10 @@ This serves the web-build and API over HTTP."
201201 (remove-hook 'after-save-hook #'org-roam-ui--on-save )
202202 (org-roam-ui-follow-mode -1 )))))
203203
204+ (defun org-roam-ui-server-runningp ()
205+ " True if the server is running or listening, otherwise false."
206+ (if (member (process-status org-roam-ui-ws-server) '(listen run)) t ))
207+
204208(defun org-roam-ui--ws-on-open (ws )
205209 " Open the websocket WS to org-roam-ui and send initial data."
206210 (progn
You can’t perform that action at this time.
0 commit comments