diff --git a/client/src/components/header/MainNavigationBar.vue b/client/src/components/header/MainNavigationBar.vue index 7ebbe0e7..5a7f599b 100644 --- a/client/src/components/header/MainNavigationBar.vue +++ b/client/src/components/header/MainNavigationBar.vue @@ -106,7 +106,7 @@ onMounted(() => { v-if=" inCourse() && courseSessionsStore.currentCourseSession && - courseSessionsStore.hasCockpit + courseSessionsStore.currentCourseSessionHasCockpit " :to="`${courseSessionsStore.currentCourseSession.course_url}/cockpit`" class="nav-item" diff --git a/client/src/pages/DashboardPage.vue b/client/src/pages/DashboardPage.vue index e7b1f3bf..8afb26a9 100644 --- a/client/src/pages/DashboardPage.vue +++ b/client/src/pages/DashboardPage.vue @@ -2,8 +2,9 @@ import LearningPathDiagramSmall from "@/components/learningPath/LearningPathDiagramSmall.vue"; import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useUserStore } from "@/stores/user"; +import type { CourseSession } from "@/types"; import log from "loglevel"; -import { onMounted } from "vue"; +import { computed, onMounted } from "vue"; log.debug("DashboardPage created"); @@ -19,6 +20,15 @@ function employer() { onMounted(async () => { log.debug("DashboardPage mounted"); }); + +const getNextStepLink = (courseSession: CourseSession) => { + return computed(() => { + if (courseSessionsStore.hasCockpit(courseSession)) { + return courseSession.cockpit_url; + } + return courseSession.learning_path_url; + }); +};