From 3f768824654a7ea484bcdc934c1f7a8c86223f0d Mon Sep 17 00:00:00 2001 From: Jaanus Sellin Date: Wed, 24 Jul 2024 15:04:33 +0300 Subject: [PATCH] fix: recently visit should only use main paths (#7655) Recently visited should only be main paths, so look like this **/segments** **/projects** and not have multiple slashes inside. --- .../src/component/commandBar/RecentlyVisitedRecorder.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/component/commandBar/RecentlyVisitedRecorder.tsx b/frontend/src/component/commandBar/RecentlyVisitedRecorder.tsx index 5f6dd1f0e8..ea6e133f98 100644 --- a/frontend/src/component/commandBar/RecentlyVisitedRecorder.tsx +++ b/frontend/src/component/commandBar/RecentlyVisitedRecorder.tsx @@ -13,7 +13,10 @@ export const RecentlyVisitedRecorder = () => { useEffect(() => { if (!location.pathname) return; - const path = routes.find((r) => r.path === location.pathname); + const path = routes.find( + (r) => + r.path === location.pathname && r.path.indexOf('/', 1) === -1, + ); if (path) { setLastVisited({ pathName: path.path }); } else if (featureMatch?.params.featureId) {