Explorar el Código

fix(editor): filter out nil commands

Andelf hace 3 años
padre
commit
cabb2952cd
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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