fix(journal): use correct config while first loading

- fix wrong journal title format
This commit is contained in:
Andelf
2022-08-20 12:46:25 +08:00
parent 375e547d1c
commit 436da5a98e

View File

@@ -277,10 +277,12 @@
(spec/validate :repos/url repo-url)
(route-handler/redirect-to-home!)
(state/set-parsing-state! {:graph-loading? true})
(let [config (or (state/get-config repo-url)
(when-let [content (some-> (first (filter #(= (config/get-config-path repo-url) (:file/path %)) nfs-files))
(let [config (or (when-let [content (some-> (first (filter #(= (config/get-config-path repo-url) (:file/path %)) nfs-files))
:file/content)]
(common-handler/read-config content)))
(common-handler/read-config content))
(state/get-config repo-url))
;; NOTE: Use config while parsing. Make sure it's the corrent journal title format
_ (state/set-config! repo-url config)
relate-path-fn (fn [m k]
(some-> (get m k)
(string/replace (js/decodeURI (config/get-local-dir repo-url)) "")))