Feature/attachment with native fs (#1078)

* feat: upload image with native fs

* improve: life of loading assets image file with nfs

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
This commit is contained in:
Charlie
2021-01-12 21:25:37 +08:00
committed by GitHub
parent 7a6ce189fc
commit 4b2dde2228
13 changed files with 209 additions and 92 deletions

View File

@@ -12,7 +12,8 @@
[frontend.spec :as spec]
[cljs-time.core :as t]
[cljs-time.format :as tf]
[frontend.config :as config]))
[frontend.config :as config]
["/frontend/utils" :as utils]))
(defn get-ref
[repo-url]
@@ -142,3 +143,12 @@
(do (log/error :token/failed-get-token token-m)
(reject)))))
nil))))))))
(defn verify-permission
[repo handle read-write?]
(let [repo (or repo (state/get-current-repo))]
(p/then
(utils/verifyPermission handle read-write?)
(fn []
(state/set-state! [:nfs/user-granted? repo] true)
true))))