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

Locale redirection doesn't work with back button #50

Closed
arctic-hen7 opened this issue Oct 5, 2021 · 0 comments
Closed

Locale redirection doesn't work with back button #50

arctic-hen7 opened this issue Oct 5, 2021 · 0 comments
Assignees
Labels
A-i18n Area: internationalization A-router Area: router C-bug Category: bug D-easy Difficulty: easy good first issue Good for newcomers P-high Priority: high S-in-development Status: in development

Comments

@arctic-hen7
Copy link
Member

Describe the bug
Right now, Perseus' locale detection system doesn't compensate for the fact that the user might press the back button in their browser after being redirected, in which case they'll be taken back to a completely blank page.

To Reproduce
Steps to reproduce the behavior:

  1. Enable i18n in any Perseus app with the locale parameter to the define_app! macro.
  2. Create an index page at /.
  3. Go to / in a browser, observe the locale redirection.
  4. Press the back button in your browser.
  5. See a blank screen.

Expected behavior
The user's back button should skip the interim locale detection page, and not display a blank page.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Perseus Version: v0.3.0-beta.6
  • Sycamore Version: v0.6.1
  • OS: Ubuntu
  • Browser: Firefox
  • Browser Version: 93

Additional context
This is due to the use of .set_href() on window.location, when we should be using .replace(), which is documented on MDN here.

@arctic-hen7 arctic-hen7 self-assigned this Oct 5, 2021
@arctic-hen7 arctic-hen7 added A-i18n Area: internationalization A-router Area: router C-bug Category: bug D-easy Difficulty: easy good first issue Good for newcomers P-high Priority: high S-in-development Status: in development labels Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-i18n Area: internationalization A-router Area: router C-bug Category: bug D-easy Difficulty: easy good first issue Good for newcomers P-high Priority: high S-in-development Status: in development
Projects
None yet
Development

No branches or pull requests

1 participant