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

View File

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