fix: скрыл информацию о студенте если её нет

This commit is contained in:
2026-05-12 00:49:15 +03:00
parent 860964e3c2
commit 462cbb360d
2 changed files with 23 additions and 3 deletions
+9 -1
View File
@@ -19,6 +19,14 @@ const userStore = useUserStore()
const router = useRouter()
const user = computed(() => auth.user!)
const userMetaLine = computed(() => {
const parts: string[] = []
if (user.value.institute) parts.push(user.value.institute)
if (user.value.direction) parts.push(user.value.direction)
if (user.value.year !== null && user.value.year !== undefined) parts.push(`${user.value.year} курс`)
return parts.join(' · ')
})
const nextLecture = computed(() => lectures.registeredLectures[0] ?? lectures.all[0])
const recommended = computed(() =>
lectures.all.filter(l => !lectures.registeredIds.includes(l.id)).slice(0, 3)
@@ -45,7 +53,7 @@ onMounted(async () => {
Добрый день, {{ formatUserName(user.name) }}!
<AppIcon class="inline-icon" icon="hand-stop" :size="18" />
</h1>
<p class="text-secondary">{{ user.institute }} · {{ user.direction }} · {{ user.year }} курс</p>
<p v-if="userMetaLine" class="text-secondary">{{ userMetaLine }}</p>
</div>
<div class="quick-actions">
<button class="btn-primary" @click="router.push('/catalog')">Найти лекцию</button>
+14 -2
View File
@@ -12,6 +12,18 @@ import EmptyState from '@/components/ui/EmptyState.vue'
const auth = useAuthStore()
const userStore = useUserStore()
const user = computed(() => auth.user!)
const userMetaLine = computed(() => {
const parts: string[] = []
if (user.value.institute) parts.push(user.value.institute)
if (user.value.direction) parts.push(user.value.direction)
return parts.join(' · ')
})
const userYearLine = computed(() => {
const year = user.value.year
return year === null || year === undefined ? '' : `${year} курс`
})
const interestTags = ref([
{ label: '#ML', active: true },
{ label: '#ИИ', active: true },
@@ -48,8 +60,8 @@ onMounted(() => {
<div>
<div class="name">{{ user.name }}</div>
<div class="email">{{ user.email }}</div>
<div class="meta">{{ user.institute }} · {{ user.direction }}</div>
<div class="meta">{{ user.year }} курс</div>
<div v-if="userMetaLine" class="meta">{{ userMetaLine }}</div>
<div v-if="userYearLine" class="meta">{{ userYearLine }}</div>
</div>
</div>
<div class="level">