1
0
Эх сурвалжийг харах

fix(windows): handle open dir

Fix #6438
Andelf 3 жил өмнө
parent
commit
fe99ca703f

+ 1 - 1
resources/js/preload.js

@@ -72,7 +72,7 @@ contextBridge.exposeInMainWorld('apis', {
 
   showItemInFolder (fullpath) {
     if (IS_WIN32) {
-      shell.openPath(path.dirname(fullpath))
+      shell.openPath(path.dirname(fullpath).replaceAll("/", "\\"))
     } else {
       shell.showItemInFolder(fullpath)
     }

+ 1 - 1
src/main/frontend/util.cljc

@@ -487,7 +487,7 @@
    (defn safe-path-join [prefix & paths]
      (let [path (apply node-path.join (cons prefix paths))]
        (if (and (electron?) (gstring/caseInsensitiveStartsWith path "file://"))
-         (subs path 7)
+         (js/decodeURIComponent (subs path 7))
          path))))
 
 (defn trim-safe