feat(encryption): add :db/encrypted? to metadata.edn

Storing the encryption status in the metadata.edn will allows the
app to prompt the user to enter the secret phrase when the graph
was already encrypted.
This commit is contained in:
Tienson Qin
2021-02-07 22:36:25 +08:00
parent 432f874c0c
commit 022abff722
3 changed files with 29 additions and 12 deletions

View File

@@ -64,18 +64,18 @@
{:type "button"
:on-click (fn []
(e/generate-mnemonic-and-save repo-url)
(close-fn))}
(close-fn true))}
(t :yes)]]
[:span.mt-3.flex.w-full.rounded-md.shadow-sm.sm:mt-0.sm:w-auto
[:button.inline-flex.justify-center.w-full.rounded-md.border.border-gray-300.px-4.py-2.bg-white.text-base.leading-6.font-medium.text-gray-700.shadow-sm.hover:text-gray-500.focus:outline-none.focus:border-blue-300.focus:shadow-outline-blue.transition.ease-in-out.duration-150.sm:text-sm.sm:leading-5
{:type "button"
:on-click close-fn}
:on-click (fn [] (close-fn false))}
(t :no)]]]]))
(defn encryption-setup-dialog
[repo-url close-fn]
(fn [close-modal-fn]
(let [close-fn (fn []
(close-fn)
(let [close-fn (fn [encrypted?]
(close-fn encrypted?)
(close-modal-fn))]
(encryption-setup-dialog-inner repo-url close-fn))))