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

fix(mobile): stat should fail

Andelf 3 жил өмнө
parent
commit
bada72fe28

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

@@ -210,7 +210,7 @@
   [dir path]
   (util/p-handle
    (stat dir path)
-   (fn [_stat] true)
+   (fn [stat] (not (nil? stat)))
    (fn [_e] false)))
 
 (defn dir-exists?

+ 2 - 1
src/main/frontend/fs/capacitor_fs.cljs

@@ -325,7 +325,8 @@
          (log/error :copy-file-failed error)))))
   (stat [_this dir path]
     (let [path (get-file-path dir path)]
-      (<stat path)))
+      (p/chain (.stat Filesystem (clj->js {:path path}))
+               #(js->clj % :keywordize-keys true))))
   (open-dir [_this _ok-handler]
     (p/let [_ (when (mobile-util/native-android?) (android-check-permission))
             {:keys [path localDocumentsPath]} (-> (.pickFolder mobile-util/folder-picker)