1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-25 10:32:31 +01:00

ui: fix DashboardRouter trailing slashes

This commit is contained in:
Matthew Penner 2023-01-13 11:58:40 -07:00
parent b59e1da860
commit e88197c4b1
No known key found for this signature in database

View File

@ -21,7 +21,7 @@ function DashboardRouter() {
{routes.account
.filter(route => route.path !== undefined)
.map(({ path, name, end = false }) => (
<NavLink key={path} to={`/account/${path ?? ''}`.replace('//', '/')} end={end}>
<NavLink key={path} to={`/account/${path ?? ''}`.replace(/\/$/, '')} end={end}>
{name}
</NavLink>
))}
@ -34,7 +34,7 @@ function DashboardRouter() {
<Route path="" element={<DashboardContainer />} />
{routes.account.map(({ route, component: Component }) => (
<Route key={route} path={`/account/${route}`.replace('//', '/')} element={<Component />} />
<Route key={route} path={`/account/${route}`.replace(/\/$/, '')} element={<Component />} />
))}
<Route path="*" element={<NotFound />} />