Skip to content

Commit e0e5e42

Browse files
authored
Remove duplicated versioned item in breadcrumbs (#1816)
1 parent 49f340b commit e0e5e42

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

portal-ui/src/screens/Console/ObjectBrowser/BrowserBreadcrumbs.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,19 @@ const BrowserBreadcrumbs = ({
8383
}
8484

8585
const splitPaths = paths.split("/").filter((path) => path !== "");
86+
const lastBreadcrumbsIndex = splitPaths.length - 1;
87+
88+
8689
let breadcrumbsMap = splitPaths.map((objectItem: string, index: number) => {
8790
const subSplit = splitPaths.slice(0, index + 1).join("/");
8891
const route = `/buckets/${bucketName}/browse/${
8992
subSplit ? `${encodeFileName(subSplit)}` : ``
9093
}`;
94+
95+
if(index === lastBreadcrumbsIndex && objectItem === versionedFile) {
96+
return null;
97+
}
98+
9199
return (
92100
<Fragment key={`breadcrumbs-${index.toString()}`}>
93101
<span> / </span>

0 commit comments

Comments
 (0)