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

Fix redirect from / to /packages breaking browser back button #248

Merged
merged 1 commit into from Dec 7, 2020
Merged

Fix redirect from / to /packages breaking browser back button #248

merged 1 commit into from Dec 7, 2020

Conversation

bmwalters
Copy link
Member

Previously, navigating to https://search.nixos.org/ would use history.pushState
to redirect to /packages and add a new entry to the browser history.
This meant that if you pressed the back button, you would navigate back to /
which would of course then redirect to /packages again.

Now history.replaceState is used instead of pushState, so the / history entry
is replaced entirely by a /packages history entry and the back button works.

Previously, navigating to https://search.nixos.org/ would use history.pushState
to redirect to /packages and add a new entry to the browser history.
This meant that if you pressed the back button, you would navigate back to /
which would of course then redirect to /packages again.

Now history.replaceState is used instead of pushState, so the / history entry
is replaced entirely by a /packages history entry and the back button works.
@bmwalters
Copy link
Member Author

For some reason the Netlify deployment is failing even after I add NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID to my repo's secrets?

Could be because of this line?

if: github.repository == 'NixOS/nixos-search'

@bmwalters
Copy link
Member Author

@garbas
Copy link
Member

garbas commented Dec 7, 2020

@bmwalters thank you for fixing this. Using replaceUrl makes more sense here.

The preview links are only generated when created from the branch on this repo. If you are planning to contribute more to nixos-search I can give you the permission to push branches, but if not I'd like to keep committers list as small as possible.

@garbas garbas merged commit bae5a92 into NixOS:master Dec 7, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants