Closed pepe closed 6 years ago
Hmm, have you checked when url is exactly the same as the default one? I mean, when the user enters the page without a correct url and the router is initialized, the navigate will be triggered because the initial url is not exactly the default one. But if you follow with a refresh this will not trigger the navigate... (I think so).
This call there is for some purpose, right now i don't remember but without it there are some situatiuons where the first trigger is not executed. I need more check before accept MR.
In any case, thanks!
Thank you, I will investigate this case you are writing about. I actually have the same feeling, that the statement is there for some reason :-).
I'll get back with what I have found, hopefully, today.
I'm having this problem too, I've got event firing twice with same name. For routes like:
(def router
(r/router [["/" :home]
["/landing" :landing]
["/auth-success" :auth-success]]))
and refreshing url like http://localhost:8911/#/landing
, I have :landing
nav happening 2 times
Oh, I totally forgot about this issue. I am actually using in production bide with this patch without any problems. It seems, that the call is actually redundant.
I'd be happy to have it landed and released in the next version.
Released as 1.6.0
. Thanks!
With
(apply on-navigate initial-loc)
line the on-navigate callback is called twice when starting router. When removed, everything seems to work ok. Tested in Chrome, Safari, and Firefox on macOS.Is there any special reason for reapplying I cannot see? It seems to me, that
.replaceToken
call on the line before removed, is enough to trigger it.