소스 검색

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