mirror of
https://github.com/penpot/penpot.git
synced 2025-02-26 00:36:12 -05:00
Cosmetic improvement to app main component.
This commit is contained in:
parent
130895f2c3
commit
632fccec5d
1 changed files with 12 additions and 20 deletions
|
@ -74,8 +74,16 @@
|
|||
|
||||
;; --- 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)
|
||||
|
@ -101,19 +109,6 @@
|
|||
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
|
||||
|
@ -137,9 +132,6 @@
|
|||
|
||||
(defn init
|
||||
[]
|
||||
(let [app-dom (gdom/getElement "app")
|
||||
lightbox-dom (gdom/getElement "lightbox")
|
||||
loader-dom (gdom/getElement "loader")]
|
||||
(rum/mount (app) app-dom)
|
||||
(rum/mount (lightbox) lightbox-dom)
|
||||
(rum/mount (loader) loader-dom)))
|
||||
(mx/mount (app) (dom/get-element "app"))
|
||||
(mx/mount (lightbox) (dom/get-element "lightbox"))
|
||||
(mx/mount (loader) (dom/get-element "loader")))
|
||||
|
|
Loading…
Add table
Reference in a new issue