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