Browse Source

chore: refine #9310

- :file/path should always be relative
- use path fn to convert url
Andelf 2 years ago
parent
commit
8d46b5cb23
1 changed files with 2 additions and 8 deletions
  1. 2 8
      src/main/frontend/handler/file_sync.cljs

+ 2 - 8
src/main/frontend/handler/file_sync.cljs

@@ -16,7 +16,6 @@
             [cljs-time.coerce :as tc]
             [cljs-time.core :as t]
             [frontend.storage :as storage]
-            [logseq.graph-parser.util :as gp-util]
             [lambdaisland.glogi :as log]))
 
 (def *beta-unavailable? (volatile! false))
@@ -168,13 +167,8 @@
   (let [file-id (:db/id (:block/file page))]
     (go
       (when-let [path (:file/path (db/entity file-id))]
-        (let [base-path (config/get-repo-dir (state/get-current-repo))
-              base-path (if (string/starts-with? base-path "file://")
-                          (gp-util/safe-decode-uri-component base-path)
-                          base-path)
-              path*     (string/replace-first (string/replace-first path base-path "") #"^/" "")
-              version-list       (:VersionList
-                                  (<! (sync/<get-remote-file-versions sync/remoteapi graph-uuid path*)))
+        (let [version-list       (:VersionList
+                                  (<! (sync/<get-remote-file-versions sync/remoteapi graph-uuid path)))
               local-version-list (<! (<list-file-local-versions page))
               all-version-list   (->> (concat version-list local-version-list)
                                       (sort-by #(or (:CreateTime %)