mirror of
https://github.com/heyarne/airsonic-ui.git
synced 2026-05-07 02:33:39 +02:00
Fix routing (r/navigate! was sometimes called twice)
This commit is contained in:
parent
8e799f651d
commit
2ccf6b3f4c
3 changed files with 51 additions and 37 deletions
|
|
@ -2,7 +2,6 @@
|
|||
(:require [reagent.core :as reagent]
|
||||
[re-frame.core :as re-frame]
|
||||
[day8.re-frame.http-fx]
|
||||
[bide.core :as r]
|
||||
[airsonic-ui.routes :as routes]
|
||||
[airsonic-ui.events :as events]
|
||||
[airsonic-ui.views :as views]
|
||||
|
|
@ -13,18 +12,12 @@
|
|||
(enable-console-print!)
|
||||
(println "dev mode")))
|
||||
|
||||
(defn on-navigate
|
||||
[id params query]
|
||||
(println "Route changed to " id params query)
|
||||
(re-frame/dispatch [::events/hash-change id params query]))
|
||||
|
||||
(defn mount-root []
|
||||
(re-frame/clear-subscription-cache!)
|
||||
(reagent/render [views/main-panel] (.getElementById js/document "app")))
|
||||
|
||||
(defn ^:export init []
|
||||
(routes/start-routing! {:default routes/default-route
|
||||
:on-navigate on-navigate})
|
||||
(routes/start-routing!)
|
||||
(re-frame/dispatch-sync [::events/initialize-db])
|
||||
(dev-setup)
|
||||
(mount-root))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue