athlete
athlete copied to clipboard
Router : default transition affecting effective routing
Context
I have a handleHistory function to help with routing. It is used in particular to handle logging out, in which case the destination (To route) points to the route of the login page ; and also the 'Back' function.
handleHistory : DirectionMsg -> MyHistory -> MyHistory
handleHistory (To route) history =
history |> push (Router.pageWithDefaultTransition route)
Symptom
The log out action triggers an infinite list of StandardHistoryMsg (Tick Int) or lands in another page.
The following change to handleHistory
(from pageWithDefaultTransition
to pageWithoutTransition
) make the application behave correctly.
handleHistory : DirectionMsg -> MyHistory -> MyHistory
handleHistory (To route) history =
history |> push (Router.pageWithoutTransition route)
No other change occurred between op / not op, and the symptom is reproductible.
Hints
Router.push
has a case
switch relative to this (isRunning transition).
Router.push
updates a transition
field of a History
value.
@ghivert can you look at that problem ?
Thank you so much !
And a SSCE would be really helpful !
Could you do an SSCCE? Without it, it's really complicated to understand what could bug. Or at least, could you show your flow in order to understand what's happening earlier and after transition.