1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00

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.
This commit is contained in:
Jaanus Sellin 2024-07-24 15:04:33 +03:00 committed by GitHub
parent 339e92f4eb
commit 3f76882465
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,7 +13,10 @@ export const RecentlyVisitedRecorder = () => {
useEffect(() => { useEffect(() => {
if (!location.pathname) return; 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) { if (path) {
setLastVisited({ pathName: path.path }); setLastVisited({ pathName: path.path });
} else if (featureMatch?.params.featureId) { } else if (featureMatch?.params.featureId) {