Skip to content

Commit 2acbbde

Browse files
authored
(fix) Decode URI segments from the path (#1445)
This basically just ensures we can match on paths with spaces and other "special" characters.
1 parent 861289c commit 2acbbde

File tree

1 file changed

+4
-1
lines changed
  • packages/framework/esm-styleguide/src/dashboard-extension

1 file changed

+4
-1
lines changed

packages/framework/esm-styleguide/src/dashboard-extension/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export const DashboardExtension = ({ path, title, basePath, icon }: DashboardExt
2727
}
2828
const paths = p.split('/');
2929

30-
const localPath = (location.pathname ?? '').split('/').slice(-1 * paths.length);
30+
const localPath = (location.pathname ?? '')
31+
.split('/')
32+
.slice(-1 * paths.length)
33+
.map(s => decodeURI(s));
3134
return shallowEqual(paths, localPath);
3235
}, [location.pathname, path]);
3336

0 commit comments

Comments
 (0)