Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Router is called twice on chromium-based browsers after refresh (F5) #262

Open
mprevel opened this issue Mar 26, 2024 · 0 comments
Open

Comments

@mprevel
Copy link

mprevel commented Mar 26, 2024

Hi,

It seems that the router is called twice after refreshing (F5) a page on chromium-based browsers (reproduced with chromium, chrome and brave on linux, but behaves as expected with Firefox).
It implies a duplication of the messages and commands that may be produced by the update function that handles the message from the router.

Adding a println allows to highlight the behavior.

  val routes: Location => Msg = {
    case loc: Location.Internal =>
      println(s"Router Internal Location: $loc")
      loc.hash.getOrElse("#/").drop(1) match
        case "/"               => Msg.NavigateTo(Page.Home)
        case _                 => Msg.NoOp
      
    case loc: Location.External =>
      println(s"Router Location External: $loc")
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant