Web Development with Clojure, Third Edition: profile page Page 228 P1.0

(defn profile [_]
   (if-let [{:keys [login created_at profile]} @(rf/subscribe [:auth/user])]
   …
      [:div.content
      [:div {:style {:width “100%”}}
      [:progress.progress.is-dark {:max 100} “30%”]]]))

When user stays on edit-profile page and performs logout, the css progress content will be shown.

Perhaps the message-list and message-form can be shown instead.

  • Is there a way to navigate to / in cljs? By reitit?
  • Pulling in message-list and message-form components from ns messages seems not natural.

On logout, you should probably use native browser navigation so that the websocket connection and any other state gets reloaded in an unauthenticated state.

You should perform navigation using JS Interop probably. See window.location API Docs if you need details.

Something like:

(-> js/document
  (.-location) 
  (.assign "/")) 

Should work.

Just finish chapter 7 and see this line on page 259 (rtfe/push-state :guestbook.routes.app/home).