瀏覽代碼

fix: graph/open and graph/remove commands

Tienson Qin 1 年之前
父節點
當前提交
a87e14d8be
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      src/main/frontend/components/cmdk.cljs

+ 5 - 3
src/main/frontend/components/cmdk.cljs

@@ -366,9 +366,11 @@
       (reset! (::input state) search-query))))
 
 (defmethod handle-action :trigger [_ state _event]
-  (when-let [action (some-> state state->highlighted-item :source-command :action)]
-    (action)
-    (close-unless-alt! state)))
+  (let [command (some-> state state->highlighted-item :source-command)]
+    (when-let [action (:action command)]
+      (action)
+      (when-not (contains? #{:graph/open :graph/remove} (:id command))
+        (close-unless-alt! state)))))
 
 (defmethod handle-action :create [_ state _event]
   (let [item (state->highlighted-item state)