 
 ;; --- Main App (Component)
 
-(defn app-render
+(defn app-will-mount
   [own]
+  (when @st/auth-ref
+    (rs/emit! (udu/fetch-profile)))
+  own)
+
+(mx/defc app
+  {:will-mount app-will-mount
+   :mixins [mx/reactive]}
+  []
   (let [route (mx/react route-ref)
         auth (mx/react st/auth-ref)
         location (:id route)

        nil
        ))))

(defn app-will-mount
  [own]
  (when @st/auth-ref
    (rs/emit! (udu/fetch-profile)))
  own)

(def app
  (mx/component
   {:render app-render
    :will-mount app-will-mount
    :mixins [mx/reactive]
    :name "app"}))

;; --- Routes

(def routes


(defn init
  []
  (mx/mount (app) (dom/get-element "app"))
  (mx/mount (lightbox) (dom/get-element "lightbox"))
  (mx/mount (loader) (dom/get-element "loader")))
