From b3078b84b62174a9482dcb4ed7d3170bd95e0289 Mon Sep 17 00:00:00 2001 From: Rob Culliton Date: Fri, 18 May 2018 11:19:42 -0400 Subject: [PATCH] store pending revocations in local storage --- src/cljs/commiteth/handlers.cljs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/cljs/commiteth/handlers.cljs b/src/cljs/commiteth/handlers.cljs index daab792..56bef55 100644 --- a/src/cljs/commiteth/handlers.cljs +++ b/src/cljs/commiteth/handlers.cljs @@ -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