Skip to content

Commit

Permalink
Routing fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SharanRP committed Aug 25, 2024
1 parent 89317b2 commit 537b750
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/AiidaExplorer/NodeGrid/FilterSidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,22 @@ const FilterSidebar = ({
<ClipLoader size={30} color="#007bff" />
</div>
}
const joinPaths = (...parts) => {
return parts
.map((part, i) => {
if (i === 0) {
return part.trim().replace(/\/*$/, '')
} else {
return part.trim().replace(/(^\/|\/*$)/g, '')
}
})
.filter(x => x.length)
.join('/')
}

const handleClick = () => {
const currentPath = location.pathname;
navigate(`${currentPath}/computers`);
navigate(joinPaths(currentPath, 'computers'));
};

return (
Expand Down

0 comments on commit 537b750

Please sign in to comment.