diff --git a/client/src/utils/route.ts b/client/src/utils/route.ts index 1ae3c477..fcc8ddf6 100644 --- a/client/src/utils/route.ts +++ b/client/src/utils/route.ts @@ -8,32 +8,32 @@ export function useRouteLookups() { } function inCockpit() { - const regex = new RegExp("/course/[^/]+/cockpit"); + const regex = new RegExp("/course/[^/]+/cockpit($|/)"); return regex.test(route.path); } function inLearningPath() { - const regex = new RegExp("/course/[^/]+/learn"); + const regex = new RegExp("/course/[^/]+/learn($|/)"); return regex.test(route.path); } function inCompetenceProfile() { - const regex = new RegExp("/course/[^/]+/competence"); + const regex = new RegExp("/course/[^/]+/competence($|/)"); return regex.test(route.path); } function inLearningMentor() { - const regex = new RegExp("/course/[^/]+/mentor"); + const regex = new RegExp("/course/[^/]+/mentor($|/)"); return regex.test(route.path); } function inMediaLibrary() { - const regex = new RegExp("/course/[^/]+/media"); + const regex = new RegExp("/course/[^/]+/media($|/)"); return regex.test(route.path); } function inAppointments() { - const regex = new RegExp("/(?:[^/]+/)?appointments"); + const regex = new RegExp("/(?:[^/]+/)?appointments($|/)"); return regex.test(route.path); }