diff --git a/frontend/src/uxbox/main/data/auth.cljs b/frontend/src/uxbox/main/data/auth.cljs index 4ef0371da..5a75c4391 100644 --- a/frontend/src/uxbox/main/data/auth.cljs +++ b/frontend/src/uxbox/main/data/auth.cljs @@ -64,7 +64,7 @@ (ptk/reify ::clear-user-data ptk/UpdateEvent (update [_ state] - (merge state (dissoc initial-state :route :router))) + (select-keys state [:route :router :session-id])) ptk/WatchEvent (watch [_ state s] @@ -79,7 +79,7 @@ (def logout (ptk/reify ::logout ptk/WatchEvent - (watch [_ state s] + (watch [_ state stream] (rx/of (rt/nav :login) clear-user-data)))) diff --git a/frontend/src/uxbox/main/store.cljs b/frontend/src/uxbox/main/store.cljs index 3154a4b0a..561605d9e 100644 --- a/frontend/src/uxbox/main/store.cljs +++ b/frontend/src/uxbox/main/store.cljs @@ -54,24 +54,9 @@ nil)) (def initial-state - {:route nil - :router nil - :session-id (uuid/next) - :auth (:auth storage) - :profile (:profile storage) - :clipboard #queue [] - :undo {} - :workspace-layout nil - :workspace-local nil - :workspace-pdata nil - :images-collections nil - :images nil - :icons-collections nil - :icons nil - :colors-collections colors/collections - :projects nil - :pages nil - :pages-data nil}) + {:session-id (uuid/next) + :profile (:profile storage)}) + ;; :colors-collections colors/collections}) (defn init "Initialize the state materialization." diff --git a/frontend/src/uxbox/main/ui.cljs b/frontend/src/uxbox/main/ui.cljs index 9f9557212..0cbb1adc2 100644 --- a/frontend/src/uxbox/main/ui.cljs +++ b/frontend/src/uxbox/main/ui.cljs @@ -109,7 +109,7 @@ (and (map? error) (= :authentication type) (= :unauthorized code)) - (ts/schedule 0 #(st/emit! (rt/nav :login))) + (ts/schedule 0 #(st/emit! logout)) ;; Network error (and (map? error)