Fix typecheck error

This commit is contained in:
Daniel Egger 2022-12-14 19:10:41 +01:00
parent e8073753be
commit 134d1f05d6
4 changed files with 5 additions and 4 deletions

View File

@ -18,7 +18,7 @@ function setIsOpen(value: boolean) {
</script>
<template>
<Dialog :open="modelValue" @close="setIsOpen" class="relative z-50">
<Dialog :open="modelValue" class="relative z-50" @close="setIsOpen">
<div class="fixed inset-0 bg-black/30" aria-hidden="true"></div>
<div class="fixed inset-0 flex items-center justify-center p-4">
<DialogPanel class="w-full max-w-2xl bg-white px-8 pt-8 pb-4">

View File

@ -86,8 +86,8 @@ function setActiveClasses(isActive: boolean) {
</ul>
<div>
<ul
class="px-8 bg-white"
v-if="competenceStore.competenceProfilePage(user.user_id)"
class="px-8 bg-white"
>
<li
v-for="competence in competenceStore.competences(user.user_id)"

View File

@ -36,7 +36,7 @@ export const useCockpitStore = defineStore({
this.courseSessionUsers = data.users;
this.cockpitSessionUser = data.cockpit_user;
if (this.cockpitSessionUser.circles?.length > 0) {
if (this.cockpitSessionUser && this.cockpitSessionUser.circles?.length > 0) {
this.selectedCircles = [this.cockpitSessionUser.circles[0].id];
}

View File

@ -34,7 +34,8 @@ export const useCourseSessionsStore = defineStore({
hasCockpit() {
const userStore = useUserStore();
return (
this.courseSessionForRoute.experts.filter(
this.courseSessionForRoute &&
(this.courseSessionForRoute as unknown as CourseSession).experts.filter(
(expert) => expert.user_id === userStore.id
).length > 0
);