Skip to content

Commit e80ba30

Browse files
fix issue with paths that have spaces
1 parent 4db0d6b commit e80ba30

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/web/src/app/[domain]/browse/hooks/useBrowseParams.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@ export const useBrowseParams = () => {
2323
const { path, pathType } = ((): { path: string, pathType: 'tree' | 'blob' } => {
2424
const path = rawPath.substring(sentinalIndex + '/-/'.length);
2525
const pathType = path.startsWith('tree/') ? 'tree' : 'blob';
26+
27+
// @note: decodedURIComponent is needed here incase the path contains a space.
2628
switch (pathType) {
2729
case 'tree':
2830
return {
29-
path: path.substring('tree/'.length),
31+
path: decodeURIComponent(path.substring('tree/'.length)),
3032
pathType,
3133
};
3234
case 'blob':
3335
return {
34-
path: path.substring('blob/'.length),
36+
path: decodeURIComponent(path.substring('blob/'.length)),
3537
pathType,
3638
};
3739
}

0 commit comments

Comments
 (0)