Revert "feature(client): Timeline page for non-login users"

This reverts commit 49beee532b.
This commit is contained in:
ThatOneCalculator 2022-08-09 19:49:23 -07:00
parent b49dd35907
commit 739d8a7b24
2 changed files with 24 additions and 25 deletions

View file

@ -3,7 +3,7 @@
<template #header><MkPageHeader v-model:tab="src" :actions="headerActions" :tabs="$i ? headerTabs : headerTabsWhenNotLogin"/></template> <template #header><MkPageHeader v-model:tab="src" :actions="headerActions" :tabs="$i ? headerTabs : headerTabsWhenNotLogin"/></template>
<MkSpacer :content-max="800"> <MkSpacer :content-max="800">
<div ref="rootEl" v-hotkey.global="keymap" class="cmuxhskf"> <div ref="rootEl" v-hotkey.global="keymap" class="cmuxhskf">
<XTutorial v-if="$i && $store.reactiveState.tutorial.value != -1" class="tutorial _block"/> <XTutorial v-if="$store.reactiveState.tutorial.value != -1" class="tutorial _block"/>
<XPostForm v-if="$store.reactiveState.showFixedPostForm.value" class="post-form _block" fixed/> <XPostForm v-if="$store.reactiveState.showFixedPostForm.value" class="post-form _block" fixed/>
<div v-if="queue > 0" class="new"><button class="_buttonPrimary" @click="top()">{{ i18n.ts.newNoteRecived }}</button></div> <div v-if="queue > 0" class="new"><button class="_buttonPrimary" @click="top()">{{ i18n.ts.newNoteRecived }}</button></div>
@ -46,8 +46,7 @@ const tlComponent = $ref<InstanceType<typeof XTimeline>>();
const rootEl = $ref<HTMLElement>(); const rootEl = $ref<HTMLElement>();
let queue = $ref(0); let queue = $ref(0);
let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global'); const src = $computed({ get: () => defaultStore.reactiveState.tl.value.src, set: (x) => saveSrc(x) });
const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
watch ($$(src), () => queue = 0); watch ($$(src), () => queue = 0);
@ -96,7 +95,7 @@ function saveSrc(newSrc: 'home' | 'local' | 'social' | 'global'): void {
...defaultStore.state.tl, ...defaultStore.state.tl,
src: newSrc, src: newSrc,
}); });
srcWhenNotSignin = newSrc ; logoutSrc = newSrc ;
} }
async function timetravel(): Promise<void> { async function timetravel(): Promise<void> {
@ -156,28 +155,31 @@ const headerTabs = $computed(() => [{
title: i18n.ts._timelines.social, title: i18n.ts._timelines.social,
icon: 'fas fa-handshake-simple', icon: 'fas fa-handshake-simple',
iconOnly: true, iconOnly: true,
}] : []), loginRequired: true,
...(isGlobalTimelineAvailable ? [{ }] : []), ...(isGlobalTimelineAvailable ? [{
key: 'global', key: 'global',
title: i18n.ts._timelines.global, title: i18n.ts._timelines.global,
icon: 'fas fa-globe', icon: 'fas fa-globe',
iconOnly: true, iconOnly: true,
}] : [])]); }] : []), {
icon: 'fas fa-list-ul',
const headerTabsWhenNotLogin = $computed(() => [ title: i18n.ts.lists,
...(isLocalTimelineAvailable ? [{ iconOnly: true,
key: 'local', loginRequired: true,
title: i18n.ts._timelines.local, onClick: chooseList,
icon: 'fas fa-user-group', }, {
iconOnly: true, icon: 'fas fa-satellite',
}] : []), title: i18n.ts.antennas,
...(isGlobalTimelineAvailable ? [{ iconOnly: true,
key: 'global', loginRequired: true,
title: i18n.ts._timelines.global, onClick: chooseAntenna,
icon: 'fas fa-globe', }, {
iconOnly: true, icon: 'fas fa-satellite-dish',
}] : []), title: i18n.ts.channel,
]); iconOnly: true,
loginRequired: true,
onClick: chooseChannel,
}]);
definePageMetadata(computed(() => ({ definePageMetadata(computed(() => ({
title: i18n.ts.timeline, title: i18n.ts.timeline,

View file

@ -453,9 +453,6 @@ export const routes = [{
path: '/timeline/antenna/:antennaId', path: '/timeline/antenna/:antennaId',
component: page(() => import('./pages/antenna-timeline.vue')), component: page(() => import('./pages/antenna-timeline.vue')),
loginRequired: true, loginRequired: true,
}, {
path: '/timeline',
component: page(() => import('./pages/timeline.vue')),
}, { }, {
name: 'index', name: 'index',
path: '/', path: '/',