Pārlūkot izejas kodu

fix(windows): handle open dir

Fix #6438
Andelf 3 gadi atpakaļ
vecāks
revīzija
fe99ca703f
2 mainītis faili ar 2 papildinājumiem un 2 dzēšanām
  1. 1 1
      resources/js/preload.js
  2. 1 1
      src/main/frontend/util.cljc

+ 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