fix: only show open a directory when nfs api is supported

Also, ask for permission when clicking the refresh button
This commit is contained in:
Tienson Qin
2020-12-02 23:29:16 +08:00
parent 552ec6d1fa
commit bcb40c6629
4 changed files with 33 additions and 13 deletions

View File

@@ -94,8 +94,9 @@
(defn check-directory-permission!
[repo]
(p/let [handle (idb/get-item (str "handle-" repo))]
(utils/verifyPermission handle true)))
(p/let [handle (idb/get-item (str "handle/" repo))]
(when handle
(utils/verifyPermission handle true))))
(defn ask-permission
[repo]
@@ -199,4 +200,11 @@
(defn- refresh!
[repo]
(reload-dir! repo))
(when repo
(p/let [verified? (check-directory-permission! repo)]
(when verified?
(reload-dir! repo)))))
(defn supported?
[]
(utils/nfsSupported))