From d47f74693a8fb58b5fd71df1463f046881ac1852 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Thu, 23 Mar 2017 18:32:01 +0200 Subject: [PATCH] Do not load user repos with timer * load user repositories on Repositories view render (in case admin token exists) instead of with interval timer * remove unused keys from re-frame default-db --- src/cljs/commiteth/db.cljs | 4 +--- src/cljs/commiteth/handlers.cljs | 3 +-- src/cljs/commiteth/repos.cljs | 4 +++- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cljs/commiteth/db.cljs b/src/cljs/commiteth/db.cljs index 303d60e..356f826 100644 --- a/src/cljs/commiteth/db.cljs +++ b/src/cljs/commiteth/db.cljs @@ -8,6 +8,4 @@ :open-bounties [] :owner-bounties {} :top-hunters [] - :activity-feed [] - :gh-token nil - :gh-admin-token nil}) + :activity-feed []}) diff --git a/src/cljs/commiteth/handlers.cljs b/src/cljs/commiteth/handlers.cljs index 7d792c4..9046d7a 100644 --- a/src/cljs/commiteth/handlers.cljs +++ b/src/cljs/commiteth/handlers.cljs @@ -96,8 +96,7 @@ (let [ls-data (update-local-storage-tokens store login token admin-token)] (println "update-tokens, ls-data:" ls-data) {:db (merge db ls-data) - :store ls-data - :dispatch [:load-user-repos]}))) + :store ls-data}))) ;; copied from plumbing.core to avoid cljsbuild warnings (defn dissoc-in diff --git a/src/cljs/commiteth/repos.cljs b/src/cljs/commiteth/repos.cljs index 75ac6fb..2c579e1 100644 --- a/src/cljs/commiteth/repos.cljs +++ b/src/cljs/commiteth/repos.cljs @@ -92,4 +92,6 @@ [:i.warning.icon] "To set bounties for your repositories or for organizations' repositories where you have access, you need to grant Commit ETH the required permissions"] [:a.ui.button.small {:href js/authorizeUrlAdmin} "Enable"]] - [repos-page-token-ok])))) + (do + (rf/dispatch [:load-user-repos]) + [repos-page-token-ok])))))