diff --git a/resources/sql/queries.sql b/resources/sql/queries.sql index e84c1a2..0a802f3 100644 --- a/resources/sql/queries.sql +++ b/resources/sql/queries.sql @@ -424,7 +424,7 @@ SELECT i.payout_hash AS payout_hash, i.payout_receipt AS payout_receipt, i.updated AS updated, - i.winner_login AS winner_login + i.winner_login AS winner_login, r.repo AS repo_name, o.address AS owner_address FROM issues i, users o, repositories r diff --git a/src/cljs/commiteth/handlers.cljs b/src/cljs/commiteth/handlers.cljs index e708215..cffac1e 100644 --- a/src/cljs/commiteth/handlers.cljs +++ b/src/cljs/commiteth/handlers.cljs @@ -182,7 +182,7 @@ (reg-event-fx :load-owner-bounties (fn [{:keys [db]} [_]] - {:db db + {:db (assoc db :owner-bounties-loading? true) :http {:method GET :url "/api/user/bounties" :on-success #(dispatch [:set-owner-bounties %])}})) @@ -190,7 +190,9 @@ (reg-event-db :set-owner-bounties (fn [db [_ issues]] - (assoc db :owner-bounties issues))) + (assoc db + :owner-bounties issues + :owner-bounties-loading? false))) (defn get-ls-token [db token] (let [login (get-in db [:user :login])] diff --git a/src/cljs/commiteth/manage_payouts.cljs b/src/cljs/commiteth/manage_payouts.cljs index 89c688f..ad7c9d2 100644 --- a/src/cljs/commiteth/manage_payouts.cljs +++ b/src/cljs/commiteth/manage_payouts.cljs @@ -59,20 +59,25 @@ (defn manage-payouts-page [] - (let [owner-bounties (rf/subscribe [:owner-bounties])] + (let [owner-bounties (rf/subscribe [:owner-bounties]) + owner-bounties-loading? (rf/subscribe [:get-in [:owner-bounties-loading?]])] (fn [] - (let [web3 (.-web3 js/window) - bounties (vals @owner-bounties) - unpaid? #(empty? (:payout_hash %)) - paid? #(not-empty (:payout_hash %)) - unpaid-bounties (filter unpaid? bounties) - paid-bounties (filter paid? bounties)] - [:div.ui.container - (when (nil? web3) - [:div.ui.warning.message - [:i.warning.icon] - "To sign off claims, please view Status Open Bounty in Status, Mist or Metamask"]) - [:h3 "New claims"] - [claim-list unpaid-bounties] - [:h3 "Old claims"] - [claim-list paid-bounties]])))) + (if @owner-bounties-loading? + [:container + [:div.ui.active.inverted.dimmer + [:div.ui.text.loader "Loading"]]] + (let [web3 (.-web3 js/window) + bounties (vals @owner-bounties) + unpaid? #(empty? (:payout_hash %)) + paid? #(not-empty (:payout_hash %)) + unpaid-bounties (filter unpaid? bounties) + paid-bounties (filter paid? bounties)] + [:div.ui.container + (when (nil? web3) + [:div.ui.warning.message + [:i.warning.icon] + "To sign off claims, please view Status Open Bounty in Status, Mist or Metamask"]) + [:h3 "New claims"] + [claim-list unpaid-bounties] + [:h3 "Old claims"] + [claim-list paid-bounties]])))))