Strip trailing slashes from routes / breadcrumbs / titles

This commit is contained in:
2023-07-19 11:16:59 -05:00
parent ba79ccb2eb
commit 95144608e5
2 changed files with 24 additions and 0 deletions

View File

@ -215,6 +215,11 @@ function NavBar({absolute, light, isMini}: Props): JSX.Element
const {pathToLabelMap} = useContext(QContext);
const fullPathToLabel = (fullPath: string, route: string): string =>
{
if(fullPath.endsWith("/"))
{
fullPath = fullPath.replace(/\/+$/, "");
}
if(pathToLabelMap && pathToLabelMap[fullPath])
{
return pathToLabelMap[fullPath];