store pending revocations in local storage

This commit is contained in:
Rob Culliton 2018-05-18 11:19:42 -04:00
parent a9282f503a
commit b3078b84b6
No known key found for this signature in database
GPG Key ID: 6FDEF60B3DC84D94
1 changed files with 12 additions and 7 deletions

View File

@ -425,18 +425,23 @@
(defn strip-0x [x]
(str/replace x #"^0x" ""))
(defn set-pending-revocation [location issue-id confirming-account]
(assoc-in location [::db/pending-revocations issue-id]
{:confirming-account confirming-account}))
(reg-event-fx
:set-pending-revocation
interceptors
(fn [{:keys [db]} [_ issue-id confirming-account]]
{:db (assoc-in db [::db/pending-revocations issue-id]
{:confirming-account confirming-account})}))
[interceptors (inject-cofx :store)]
(fn [{:keys [db store]} [_ issue-id confirming-account]]
{:db (set-pending-revocation db issue-id confirming-account)
:store (set-pending-revocation store issue-id confirming-account)}))
(reg-event-fx
:remove-pending-revocation
interceptors
(fn [{:keys [db]} [_ issue-id]]
{:db (dissoc-in db [::db/pending-revocations issue-id])}))
[interceptors (inject-cofx :store)]
(fn [{:keys [db store]} [_ issue-id]]
{:db (dissoc-in db [::db/pending-revocations issue-id])
:store (dissoc-in store [::db/pending-revocations issue-id])}))
(reg-event-fx
:remove-bot-confirmation