Explorar el Código

fix: temporal validation for the current graph's config

related to #7794, #7795
Tienson Qin hace 3 años
padre
commit
ae77281f47
Se han modificado 1 ficheros con 8 adiciones y 3 borrados
  1. 8 3
      src/main/frontend/state.cljs

+ 8 - 3
src/main/frontend/state.cljs

@@ -330,6 +330,11 @@
              new))
          configs))
 
+(defn validate-current-config
+  "TODO: Temporal fix"
+  [config]
+  (when (map? config) config))
+
 (defn get-config
   "User config for the given repo or current repo if none given. All config fetching
 should be done through this fn in order to get global config and config defaults"
@@ -339,7 +344,7 @@ should be done through this fn in order to get global config and config defaults
    (merge-configs
     default-config
     (get-in @state [:config ::global-config])
-    (get-in @state [:config repo-url]))))
+    (validate-current-config (get-in @state [:config repo-url])))))
 
 (defonce publishing? (atom nil))
 
@@ -551,10 +556,10 @@ Similar to re-frame subscriptions"
   "Sub equivalent to get-config which should handle all sub user-config access"
   ([] (sub-config (get-current-repo)))
   ([repo]
-   (let [config (sub :config)]
+   (let [config (validate-current-config (sub :config))]
      (merge-configs default-config
                     (get config ::global-config)
-                    (get config repo)))))
+                    (validate-current-config (get config repo))))))
 
 (defn enable-grammarly?
   []