|
|
@@ -1,5 +1,5 @@
|
|
|
-(ns frontend.handler.file
|
|
|
- "Provides util handler fns for files"
|
|
|
+(ns frontend.handler.file-based.file
|
|
|
+ "Provides util handler fns for file graph files"
|
|
|
(:refer-clojure :exclude [load-file])
|
|
|
(:require [frontend.config :as config]
|
|
|
[frontend.db :as db]
|
|
|
@@ -35,7 +35,7 @@
|
|
|
(println "Load file failed: " path)
|
|
|
(js/console.error e)))))
|
|
|
|
|
|
-(defn load-multiple-files
|
|
|
+(defn- load-multiple-files
|
|
|
[repo-url paths]
|
|
|
(doall
|
|
|
(mapv #(load-file repo-url %) paths)))
|
|
|
@@ -92,7 +92,7 @@
|
|
|
[path content]
|
|
|
(when (or (= path "logseq/config.edn")
|
|
|
(= (path/dirname path) (global-config-handler/safe-global-config-dir)))
|
|
|
- (config-edn-common-handler/detect-deprecations path content {:db-graph? (config/db-based-graph? (state/get-current-repo))})))
|
|
|
+ (config-edn-common-handler/detect-deprecations path content {:db-graph? false})))
|
|
|
|
|
|
(defn- validate-file
|
|
|
"Returns true if valid and if false validator displays error message. Files
|
|
|
@@ -202,7 +202,7 @@
|
|
|
(alter-file repo path new-content {:reset? false
|
|
|
:re-render-root? false}))
|
|
|
|
|
|
-(defn alter-files-handler!
|
|
|
+(defn- alter-files-handler!
|
|
|
[repo files {:keys [finish-handler]} file->content]
|
|
|
(let [write-file-f (fn [[path content]]
|
|
|
(when path
|
|
|
@@ -255,7 +255,7 @@
|
|
|
(defn watch-for-current-graph-dir!
|
|
|
[]
|
|
|
(when-let [repo (state/get-current-repo)]
|
|
|
- (when-let [dir (and (not (config/db-based-graph? repo)) (config/get-repo-dir repo))]
|
|
|
+ (when-let [dir (config/get-repo-dir repo)]
|
|
|
;; An unwatch shouldn't be needed on startup. However not having this
|
|
|
;; after an app refresh can cause stale page data to load
|
|
|
(fs/unwatch-dir! dir)
|