Appsilon / shiny.router

A minimalistic router for your Shiny apps.
http://appsilon.github.io/shiny.router
Other
255 stars 31 forks source link

Fix displaying main page bookmark on app start #82

Closed jakubsob closed 3 years ago

jakubsob commented 3 years ago

Resolves #46

The hashpath is not updated when opening default page, each other time it works correctly. Added update of hashpath to be run once after default router page is being set-up.

rszymanski commented 3 years ago

I have tested the change and confirm that when I open the app in a new tab for the first time I get redirected to the main page :D

There is also another case which we might want to handle:

  1. Open the app in a new tab (paste <app_link>/#!/)
  2. The page redirects to the main page bookmark (<app_link>/#!/<main_page_bookmark>)
  3. Manually change the url in the tab to <app_link>/#!/
  4. The url stays as <app_link>/#!/ and the app remains functional (it does not get changed to <app_link>/#!/<main_page_bookmark>)
jakubsob commented 3 years ago

@rszymanski I've changed the mechanism of routing to default bookmark. Now an app opens with correct default url and redirects there when changing url to #!/

rszymanski commented 3 years ago

Retested the new changes -- it works :)

LGTM, approving :D

przytu1 commented 3 years ago

LGTM