Skip to content
Snippets Groups Projects
Commit 66f86bf1 authored by Federico Brigante's avatar Federico Brigante Committed by Caleb Cartwright
Browse files

Don't break the back button when redirecting legacy routes (#4305)

* Don't break the back button when redirecting legacy routes

* Prettier
parent a3989dd0
No related branches found
No related tags found
No related merge requests found
...@@ -4,8 +4,12 @@ export default function redirectLegacyRoutes() { ...@@ -4,8 +4,12 @@ export default function redirectLegacyRoutes() {
const { hash } = window.location const { hash } = window.location
if (hash && hash.startsWith('#/examples/')) { if (hash && hash.startsWith('#/examples/')) {
const category = hash.replace('#/examples/', '') const category = hash.replace('#/examples/', '')
navigate(`category/${category}`) navigate(`category/${category}`, {
replace: true,
})
} else if (hash === '#/endpoint') { } else if (hash === '#/endpoint') {
navigate('endpoint') navigate('endpoint', {
replace: true,
})
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment