Don't break the back button when redirecting legacy routes (#4305)
* Don't break the back button when redirecting legacy routes * Prettier
This commit is contained in:
committed by
Caleb Cartwright
parent
a3989dd0bd
commit
66f86bf1f7
@@ -4,8 +4,12 @@ export default function redirectLegacyRoutes() {
|
||||
const { hash } = window.location
|
||||
if (hash && hash.startsWith('#/examples/')) {
|
||||
const category = hash.replace('#/examples/', '')
|
||||
navigate(`category/${category}`)
|
||||
navigate(`category/${category}`, {
|
||||
replace: true,
|
||||
})
|
||||
} else if (hash === '#/endpoint') {
|
||||
navigate('endpoint')
|
||||
navigate('endpoint', {
|
||||
replace: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user