瀏覽代碼

fix(editor): filter out nil commands

Andelf 3 年之前
父節點
當前提交
cabb2952cd
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/main/frontend/modules/shortcut/data_helper.cljs

+ 2 - 0
src/main/frontend/modules/shortcut/data_helper.cljs

@@ -190,7 +190,9 @@
 
 (defn shortcuts->commands [handler-id]
   (let [m (get @config/config handler-id)]
+    ;; NOTE: remove nil vals, since some commands are conditional
     (->> m
+         (filter (comp some? val))
          (map (fn [[id _]] (-> (shortcut-data-by-id id)
                                (assoc :id id :handler-id handler-id)
                                (rename-keys {:binding :shortcut