From 12e4d98d58e01710eb4b0daf4fedbca68e9dd957 Mon Sep 17 00:00:00 2001 From: Rob Culliton Date: Mon, 7 May 2018 11:07:14 -0400 Subject: [PATCH] handler for setting pending revocations comment out confirm hash interceptor for now --- src/cljs/commiteth/db.cljs | 1 + src/cljs/commiteth/handlers.cljs | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/cljs/commiteth/db.cljs b/src/cljs/commiteth/db.cljs index 295969f..b4593d8 100644 --- a/src/cljs/commiteth/db.cljs +++ b/src/cljs/commiteth/db.cljs @@ -19,6 +19,7 @@ ::ui-model/bounty-filter-type|date nil ::ui-model/bounty-filter-type|owner nil} ::open-bounty-claims #{} + ::pending-revocations #{} :owner-bounties {} :top-hunters [] :activity-feed []}) diff --git a/src/cljs/commiteth/handlers.cljs b/src/cljs/commiteth/handlers.cljs index a3104bf..d762791 100644 --- a/src/cljs/commiteth/handlers.cljs +++ b/src/cljs/commiteth/handlers.cljs @@ -222,7 +222,7 @@ (reg-event-db :set-owner-bounties - [commiteth.interceptors/confirm-hash-update] +;; [commiteth.interceptors/confirm-hash-update] (fn [db [_ issues]] (assoc db :owner-bounties issues @@ -413,17 +413,20 @@ (str/replace x #"^0x" "")) (reg-event-fx - :revoke-bounty-success + :set-pending-revocation interceptors + (fn [{:keys [db]} [_ issue-id]] + {:db (update db ::db/pending-revocations #(conj % issue-id))})) + +(reg-event-fx + :remove-pending-revocation + (fn [{:keys [db]} [_ issue-id]] + {:db (update db ::db/pending-revocations #(disj % issue-id))})) + +(reg-event-fx + :revoke-bounty-success (fn [{:keys [db]} [_ {:keys [issue-id owner-address contract-address confirm-hash]}]] - ;; replace with dispatch of pending banner - ;; confirm-payout dispatch will be called by a component - ;; that subscribes to owner-bounties - ;; which will get an updated confirm_hash from the scheduler - {:dispatch [:confirm-payout {:issue_id issue-id - :owner_address owner-address - :contract_address contract-address - :confirm_hash confirm-hash}]})) + {:dispatch [:set-pending-revocation issue-id]})) (reg-event-fx :revoke-bounty-error