Closed AurelienRichez closed 6 years ago
So, just to be sure: Any number of redirections while transitionning worked (only one history state pushed) but only on subsequent state changes, not during init?
@AlexGalays Yes. Transitions worked fine after initialization (only one pushed state even with several redirects). The problem happened if a transition occured during init. There was also one pushed state but a replaceState seems more consistent in this case to avoid "polluting" the history.
This changes the behaviour of abyssa but I don't know if adding this as a configurable parameter would be really useful 🤔.
In general I think the number of config params should be kept to an absolute minimum :D Not polluting the history seems like it's a bug fix rather than a new way of doing things so I'm fine the way you did it.
Fixed in 8.0.8
Currently, if a redirect happens during initialization, we end up with two entries in history (first entry when the browser open the page, second from the redirection).
When the user goes back in the history, il goes back to the first entry which redirects to the second one :-(, so
history.back()
becomes unusable unless we go back 2 states at once.This PR changes this behaviour :
history.replaceState
is calledWe added the corresponding tests.