Browse Source

Encode graph dir on mobile

Tienson Qin 3 năm trước cách đây
mục cha
commit
ccdecf8b86
2 tập tin đã thay đổi với 6 bổ sung2 xóa
  1. 1 1
      src/main/frontend/config.cljs
  2. 5 1
      src/main/frontend/handler/web/nfs.cljs

+ 1 - 1
src/main/frontend/config.cljs

@@ -370,7 +370,7 @@
     path
     (util/node-path.join (get-repo-dir repo-url) path)))
 
-;; FIXME: There is another get-file-path at src/main/frontend/fs/capacitor_fs.cljs
+;; FIXME: There is another normalize-file-protocol-path at src/main/frontend/fs/capacitor_fs.cljs
 (defn get-file-path
   "Normalization happens here"
   [repo-url relative-path]

+ 5 - 1
src/main/frontend/handler/web/nfs.cljs

@@ -23,7 +23,8 @@
             [lambdaisland.glogi :as log]
             [logseq.graph-parser.config :as gp-config]
             [logseq.graph-parser.util :as gp-util]
-            [promesa.core :as p]))
+            [promesa.core :as p]
+            [frontend.fs.capacitor-fs :as capacitor-fs]))
 
 (defn remove-ignore-files
   [files dir-name nfs?]
@@ -152,6 +153,9 @@
               dir-name (if nfs?
                          (gobj/get root-handle "name")
                          root-handle)
+              dir-name (if (mobile-util/native-platform?)
+                         (capacitor-fs/normalize-file-protocol-path "" dir-name)
+                         dir-name)
               repo (str config/local-db-prefix dir-name)
               _ (state/set-loading-files! repo true)
               _ (when-not (or (state/home?) (state/setups-picker?))