Skip to content

Commit

Permalink
UHM-8309: remove extra '/' from the returnUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
cioan committed Feb 4, 2025
1 parent e5b6439 commit a58f318
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions app/js/components/shared/BreadCrumb/BreadCrumb.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,15 @@ class BreadCrumb extends Component {
}
let outputBreadcrumb;
const contextPath = window.location.href.split('/')[3];
const url = localStorage.getItem('returnUrl');
const returnUrl = `/${contextPath}/${url}`;
let url = localStorage.getItem('returnUrl');
if (url && (url !== 'null') && (url.length > 1)) {
if (url.startsWith("/")) {
url = url.substring(1); // skip the leading "/"
}
} else {
url = '';
}
const returnUrl = url ? `/${contextPath}/${url}` : `/${contextPath}`;

const homePageBreadcrumb = (
<span>
Expand Down

0 comments on commit a58f318

Please sign in to comment.