mirror of https://github.com/status-im/reagent.git
Tweak history handling in demo
This commit is contained in:
parent
86b98dcdba
commit
fe749392d7
|
@ -43,8 +43,9 @@
|
|||
:goto-page (let [path x
|
||||
_ (assert (string? path))]
|
||||
(when-some [h history]
|
||||
(r/after-render (fn []
|
||||
(.setToken h x)
|
||||
(r/after-render #(set! js/document.body.scrollTop 0))
|
||||
(js/scrollTo 0 0)))
|
||||
state)
|
||||
(recur state [:set-page x]))))
|
||||
|
||||
|
@ -76,7 +77,8 @@
|
|||
(string/replace #"/*$" ""))))
|
||||
(History.)))
|
||||
(evt/listen EventType.NAVIGATE #(when (.-isNavigation %)
|
||||
(emit [:set-page (.-token %)])))
|
||||
(emit [:set-page (.-token %)])
|
||||
(r/flush)))
|
||||
(.setEnabled true))
|
||||
(let [token (.getToken history)
|
||||
p (if (and page (not html5) (empty? token))
|
||||
|
|
Loading…
Reference in New Issue