       (swap! config merge conf)
       (when page-name
         (set-start-page page-name))
-      (setup-history)
+      (setup-history page-name)
       (set! (.-title js/document) (get-title))
       (reagent/render-component (body)
                                 (.' js/document :body)))))

           (.isSupported Html5History)
           (#{"http:" "https:"} proto)))))

(defn create-history []
  (if (use-html5-history)
    (doto (Html5History.)
      (.setUseFragment false))
    (doto (History.)
      (.setToken @page))))

(def history nil)


  (if (use-html5-history)
    (:base-path @config)))

(defn setup-history [p]
  (when (nil? history)
    (set! history (create-history p))
    (swap! page-state assoc :has-history (some? history))
    (when-let [h history]
      (evt/listen h hevt/NAVIGATE
