diff --git a/src/uxbox/core.cljs b/src/uxbox/core.cljs index b06dfe196..6b4b9f575 100644 --- a/src/uxbox/core.cljs +++ b/src/uxbox/core.cljs @@ -10,16 +10,9 @@ (enable-console-print!) -(def ^:const ^:private +persistent-keys+ - [:auth - :pages-by-id - :shapes-by-id - :colors-by-id - :projects-by-id]) - (defn- main [] - (let [lens (l/select-keys +persistent-keys+) + (let [lens (l/select-keys dl/+persistent-keys+) stream (->> (l/focus-atom lens st/state) (rx/from-atom) (rx/dedupe) diff --git a/src/uxbox/data/load.cljs b/src/uxbox/data/load.cljs index 5765e6d9b..cde41abcf 100644 --- a/src/uxbox/data/load.cljs +++ b/src/uxbox/data/load.cljs @@ -24,14 +24,21 @@ (let [id (:id shape)] (update state :shapes-by-id assoc id shape))) +(def ^:const ^:private +persistent-keys+ + [:auth + :pages-by-id + :shapes-by-id + :colors-by-id + :projects-by-id]) + (defn persist-state [state] (let [pages (into #{} (vals (:pages-by-id state))) projects (into #{} (vals (:projects-by-id state))) shapes (into #{} (vals (:shapes-by-id state))) color-colls (into #{} (vals (:colors-by-id state)))] - (assoc! local-storage :data {:pages pages + :auth (:auth state) :shapes shapes :projects projects :color-collections color-colls}))) diff --git a/src/uxbox/router.cljs b/src/uxbox/router.cljs index f39abd85e..b89b33ff9 100644 --- a/src/uxbox/router.cljs +++ b/src/uxbox/router.cljs @@ -23,6 +23,7 @@ (reify rs/UpdateEvent (-apply-update [_ state] + ;; (println "update-location" handler route-params) (let [route (merge {:id handler} (when route-params {:params route-params}))] @@ -35,6 +36,7 @@ (reify rs/EffectEvent (-apply-effect [_ state] + ;; (println "navigate" id params) (let [loc (merge {:handler id} (when params {:route-params params}))] diff --git a/src/uxbox/state.cljs b/src/uxbox/state.cljs index dcc67e16e..ff04fae15 100644 --- a/src/uxbox/state.cljs +++ b/src/uxbox/state.cljs @@ -8,7 +8,7 @@ (rs/init {:dashboard {:project-order :name :project-filter ""} :route nil - :auth nil + :auth {} :workspace nil :shapes-by-id {} :elements-by-id {}