diff --git a/src/uxbox/state.cljs b/src/uxbox/state.cljs index b94eada9c..66438c494 100644 --- a/src/uxbox/state.cljs +++ b/src/uxbox/state.cljs @@ -9,8 +9,11 @@ (:require [beicon.core :as rx] [lentes.core :as l] [uxbox.rstore :as rs] + [uxbox.locales :refer (tr)] [uxbox.util.storage :refer (storage)])) +(enable-console-print!) + (defonce state (atom {})) (def auth-l @@ -19,7 +22,7 @@ (def loader (atom false)) -(defn get-initial-state +(defn- get-initial-state [] {:dashboard {:project-order :name :project-filter ""} @@ -35,6 +38,13 @@ :projects-by-id {} :pages-by-id {}}) +(defn- on-error + [error] + ;; Disable loader in case of error. + (reset! loader false)) + +(rs/add-error-watcher :test on-error) + (defonce stream (rs/init (get-initial-state)))