Fix decrypting of file from git

pull/1073/head
Kan-Ru Chen 2021-01-08 00:55:26 +09:00
parent aeb50df515
commit aff55b61df
1 changed files with 10 additions and 9 deletions

View File

@ -160,8 +160,8 @@
([dir path]
(read-file dir path (clj->js {:encoding "utf8"})))
([dir path option]
(decrypt secret
(cond
(p/let
[encrypted-content (cond
(local-db? dir)
(let [handle-path (str "handle" dir "/" path)]
(p/let [handle (idb/get-item handle-path)
@ -169,7 +169,8 @@
(and local-file (.text local-file))))
:else
(js/window.pfs.readFile (str dir "/" path) option)))))
(js/window.pfs.readFile (str dir "/" path) option))]
(decrypt secret encrypted-content))))
(defn nfs-saved-handler
[repo path file]