From 921b86ff7f8aa0c37db38ab0c6809e15edbc81c8 Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Thu, 13 Apr 2017 12:18:39 +0300 Subject: [PATCH] Fix repo loading bug, update dependencies * fix UI getting frozen in manage repos view * update dependencies --- project.clj | 16 ++++++++-------- src/cljs/commiteth/handlers.cljs | 20 +++++++++++--------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/project.clj b/project.clj index 14b41f2..e640314 100644 --- a/project.clj +++ b/project.clj @@ -4,13 +4,13 @@ :dependencies [[metosin/compojure-api "1.1.10" :exclusions [joda-time]] [re-frame "0.9.2"] - [cljs-ajax "0.5.8"] + [cljs-ajax "0.5.9"] [secretary "1.2.3"] [reagent-utils "0.2.1"] [reagent "0.6.1"] - [org.clojure/clojurescript "1.9.495"] + [org.clojure/clojurescript "1.9.518"] [org.clojure/clojure "1.8.0"] - [selmer "1.10.6"] + [selmer "1.10.7"] [markdown-clj "0.9.98"] [ring-middleware-format "0.7.2"] [metosin/ring-http-response "0.8.2"] @@ -42,7 +42,7 @@ [mpg "1.3.0"] [pandect "0.6.1"] [cljsjs/moment "2.17.1-0"] - [org.clojure/tools.nrepl "0.2.12"] + [org.clojure/tools.nrepl "0.2.13"] [com.cemerick/piggieback "0.2.1"] [jarohen/chime "0.2.0"] [com.andrewmcveigh/cljs-time "0.4.0"] @@ -112,10 +112,10 @@ [pjstadig/humane-test-output "0.8.1"] [doo "0.1.7"] [binaryage/devtools "0.9.2"] - [figwheel-sidecar "0.5.9"] - [org.clojure/tools.nrepl "0.2.12"] + [figwheel-sidecar "0.5.10"] + [org.clojure/tools.nrepl "0.2.13"] [com.cemerick/piggieback "0.2.1"] - [sablono "0.7.7"]] + [sablono "0.8.0"]] :plugins [[com.jakemccrary/lein-test-refresh "0.14.0"] [lein-doo "0.1.7"] [lein-figwheel "0.5.9"]] @@ -140,7 +140,7 @@ :injections [(require 'pjstadig.humane-test-output) (pjstadig.humane-test-output/activate!)]} :test {:resource-paths ["env/dev/resources" "env/test/resources"] - :dependencies [[devcards "0.2.2"]] + :dependencies [[devcards "0.2.3"]] :cljsbuild {:builds {:test diff --git a/src/cljs/commiteth/handlers.cljs b/src/cljs/commiteth/handlers.cljs index f48e191..cdeb69a 100644 --- a/src/cljs/commiteth/handlers.cljs +++ b/src/cljs/commiteth/handlers.cljs @@ -213,15 +213,17 @@ (reg-event-fx :load-user-repos (fn [{:keys [db]} [_]] - (conj {:db (assoc db :repos-loading? true)} - (when-let [token (get-admin-token db)] - :http {:method GET - :url "/api/user/repositories" - :params {:token token} - :on-success #(dispatch [:set-user-repos (:repositories %)]) - :on-error #(dispatch [:set-flash-message - :error "Failed to load repositories"]) - :finally #(dispatch [:clear-repos-loading])})))) + (let [token (get-admin-token db)] + (conj {:db (if token (assoc db :repos-loading? true) + db)} + (when token + {:http {:method GET + :url "/api/user/repositories" + :params {:token token} + :on-success #(dispatch [:set-user-repos (:repositories %)]) + :on-error #(dispatch [:set-flash-message + :error "Failed to load repositories"]) + :finally #(dispatch [:clear-repos-loading])}}))))) (defn update-repo-state [all-repos full-name data]