diff --git a/src/clj/commiteth/bounties.clj b/src/clj/commiteth/bounties.clj index 3358015..827f1c5 100644 --- a/src/clj/commiteth/bounties.clj +++ b/src/clj/commiteth/bounties.clj @@ -107,12 +107,14 @@ (issues/update-issue-title (:id gh-issue) (:title gh-issue))))))) (defn bounty-state [bounty] - (cond - (:payout_hash bounty) :paid - (nil? (:confirm_hash bounty)) :pending-maintainer-confirmation - (nil? (:payout_address bounty)) :pending-contributor-address - (:winner_login bounty) :merged - (some-> (:claim_count bounty) (< 1)) :multiple_claims - (= 1 (:claim_count bounty)) :claimed - (seq (:tokens bounty)) :funded - (:contract_address bounty) :opened)) + (if-let [merged? (:winner_login bounty)] + (cond + (nil? (:payout_address bounty)) :pending-contributor-address + (nil? (:confirm_hash bounty)) :pending-maintainer-confirmation + (:payout_hash bounty) :paid + :else :merged) + (cond ; not yet merged + (some-> (:claim_count bounty) (< 1)) :multiple_claims + (= 1 (:claim_count bounty)) :claimed + (seq (:tokens bounty)) :funded + (:contract_address bounty) :opened)))