fix(config): global config validation

This commit is contained in:
Andelf
2023-03-17 10:05:10 +08:00
parent da975da3da
commit 9637c464eb
4 changed files with 26 additions and 18 deletions

View File

@@ -96,7 +96,6 @@
[nil path])]
(when (and format (contains? (gp-config/text-formats) format))
(p/let [content (fs/read-file dir path)]
(prn ::read-content dir path content)
(reset! *content (or content ""))))
(assoc state ::file-content *content)))
:did-mount (fn [state]
@@ -110,7 +109,7 @@
rel-path (when (string/starts-with? path repo-dir)
(path/trim-dir-prefix repo-dir path))
original-name (db/get-file-page (or path rel-path))
in-db? (boolean (db/get-file (or path rel-path)))
in-db? (boolean (and rel-path (db/get-file (or path rel-path))))
file-fpath (if in-db?
(path/path-join repo-dir path)
path)