Remove CS switcher when not in course
This commit is contained in:
parent
b682c5561f
commit
fd9f2162c5
|
|
@ -2,6 +2,7 @@
|
|||
import CourseSessionsMenu from "@/components/header/CourseSessionsMenu.vue";
|
||||
import type { User } from "@/stores/user";
|
||||
import type { CourseSession } from "@/types";
|
||||
import { useRouteLookups } from "@/utils/route";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
@ -13,6 +14,7 @@ const props = defineProps<{
|
|||
const emit = defineEmits(["selectCourseSession", "logout", "close"]);
|
||||
|
||||
const router = useRouter();
|
||||
const { inCourse } = useRouteLookups();
|
||||
|
||||
async function navigate(routeName: string) {
|
||||
await router.push({ name: routeName });
|
||||
|
|
@ -41,7 +43,7 @@ async function navigate(routeName: string) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="props.courseSessions.length" class="border-b py-4">
|
||||
<div v-if="props.courseSessions.length && inCourse()" class="border-b py-4">
|
||||
<CourseSessionsMenu
|
||||
:items="courseSessions"
|
||||
:selected="selectedCourseSession"
|
||||
|
|
|
|||
Loading…
Reference in New Issue