fix: make inX helpers more robust
-> do really just match /learn and /learn/x not learnXXX
This commit is contained in:
parent
2989085a42
commit
77b4f9cfe3
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue