1
0
Andelf 2 жил өмнө
parent
commit
113715c8a1

+ 2 - 4
src/main/frontend/components/file.cljs

@@ -21,8 +21,7 @@
             [promesa.core :as p]
             [reitit.frontend.easy :as rfe]
             [rum.core :as rum]
-            [logseq.common.path :as path]
-            [frontend.handler.global-config :as global-config-handler]))
+            [logseq.common.path :as path]))
 
 (defn- get-path
   [state]
@@ -136,8 +135,7 @@
      (cond
        ;; image type
        (and format (contains? (gp-config/img-formats) format))
-       ;; FIXME(andelf): bad path op
-       [:img {:src (util/node-path.join "file://" path)}]
+       [:img {:src (path/path-join "file://" path)}]
 
        (and format
             (contains? (gp-config/text-formats) format)

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

@@ -383,8 +383,7 @@
     (let [dir (get-local-dir repo-url)]
       (if (string/starts-with? dir "file://")
         dir
-        ;; FIXME(andelf): should not use str to concat file:// url
-        (str "file:///" (string/replace dir #"^/+" ""))))
+        (path/path-join "file://" dir)))
 
     ;; Special handling for demo graph
     (= repo-url "local")