add additional check to interceptor to only proceed during a pending revocation
This commit is contained in:
parent
773da8d074
commit
eed60f8360
|
@ -43,14 +43,17 @@
|
|||
:coeffects
|
||||
:event
|
||||
first)
|
||||
pending-revocations (get-in context [:coeffects :db ::db/pending-revocations])
|
||||
start-ob (get-in context [:coeffects :db :owner-bounties])
|
||||
end-ob (get-in context [:effects :db :owner-bounties])]
|
||||
;; proceed when the change isn't caused by page load
|
||||
(when (not-empty start-ob)
|
||||
(let [[only-before only-after both] (data/diff
|
||||
(bounty-confirm-hashes start-ob)
|
||||
(bounty-confirm-hashes end-ob))]
|
||||
|
||||
(when only-after ;; confirm hashes changed, now find out which ones
|
||||
;; proceed when confirm hashes have changed and there is a pending revocation
|
||||
(when (and only-after (not-empty pending-revocations))
|
||||
(println "pending revocations are " pending-revocations)
|
||||
(let [updated-bounties (->> end-ob
|
||||
(filter-updated-bounties start-ob)
|
||||
vals)]
|
||||
|
|
Loading…
Reference in New Issue