fix: change header for not logged in users

just for not show any error message when exploring
This commit is contained in:
아르페 2023-12-01 11:44:24 +09:00 committed by GitHub
parent ce8ed1fe04
commit 42fe311524
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,7 +5,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<MkStickyContainer> <MkStickyContainer>
<template #header><MkPageHeader v-model:tab="tab" :actions="headerActions" :tabs="headerTabs"/></template> <template #header>
<MkPageHeader v-model:tab="tab" :actions="$i ? headerActions : null" :tabs="$i ? headerTabs : headerTabsWhenNotLogin" :displayMyAvatar="true"/>
</template>
<MkSpacer :contentMax="700"> <MkSpacer :contentMax="700">
<div v-if="tab === 'search'"> <div v-if="tab === 'search'">
<div class="_gaps"> <div class="_gaps">
@ -59,6 +61,7 @@ import MkRadios from '@/components/MkRadios.vue';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import MkFoldableSection from '@/components/MkFoldableSection.vue'; import MkFoldableSection from '@/components/MkFoldableSection.vue';
import { useRouter } from '@/router.js'; import { useRouter } from '@/router.js';
import { $i } from '@/account.js';
import { definePageMetadata } from '@/scripts/page-metadata.js'; import { definePageMetadata } from '@/scripts/page-metadata.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
@ -149,6 +152,16 @@ const headerTabs = $computed(() => [{
icon: 'ti ti-edit', icon: 'ti ti-edit',
}]); }]);
const headerTabsWhenNotLogin = $computed(() => [{
key: 'search',
title: i18n.ts.search,
icon: 'ti ti-search',
}, {
key: 'featured',
title: i18n.ts._channel.featured,
icon: 'ti ti-comet',
}]);
definePageMetadata(computed(() => ({ definePageMetadata(computed(() => ({
title: i18n.ts.channel, title: i18n.ts.channel,
icon: 'ti ti-device-tv', icon: 'ti ti-device-tv',