Revert "feature(client): Timeline page for non-login users"
This reverts commit 49beee532b
.
This commit is contained in:
parent
b49dd35907
commit
739d8a7b24
2 changed files with 24 additions and 25 deletions
|
@ -3,7 +3,7 @@
|
|||
<template #header><MkPageHeader v-model:tab="src" :actions="headerActions" :tabs="$i ? headerTabs : headerTabsWhenNotLogin"/></template>
|
||||
<MkSpacer :content-max="800">
|
||||
<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/>
|
||||
|
||||
<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>();
|
||||
|
||||
let queue = $ref(0);
|
||||
let srcWhenNotSignin = $ref(isLocalTimelineAvailable ? 'local' : 'global');
|
||||
const src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
|
||||
const src = $computed({ get: () => defaultStore.reactiveState.tl.value.src, set: (x) => saveSrc(x) });
|
||||
|
||||
watch ($$(src), () => queue = 0);
|
||||
|
||||
|
@ -96,7 +95,7 @@ function saveSrc(newSrc: 'home' | 'local' | 'social' | 'global'): void {
|
|||
...defaultStore.state.tl,
|
||||
src: newSrc,
|
||||
});
|
||||
srcWhenNotSignin = newSrc ;
|
||||
logoutSrc = newSrc ;
|
||||
}
|
||||
|
||||
async function timetravel(): Promise<void> {
|
||||
|
@ -156,28 +155,31 @@ const headerTabs = $computed(() => [{
|
|||
title: i18n.ts._timelines.social,
|
||||
icon: 'fas fa-handshake-simple',
|
||||
iconOnly: true,
|
||||
}] : []),
|
||||
...(isGlobalTimelineAvailable ? [{
|
||||
loginRequired: true,
|
||||
}] : []), ...(isGlobalTimelineAvailable ? [{
|
||||
key: 'global',
|
||||
title: i18n.ts._timelines.global,
|
||||
icon: 'fas fa-globe',
|
||||
iconOnly: true,
|
||||
}] : [])]);
|
||||
|
||||
const headerTabsWhenNotLogin = $computed(() => [
|
||||
...(isLocalTimelineAvailable ? [{
|
||||
key: 'local',
|
||||
title: i18n.ts._timelines.local,
|
||||
icon: 'fas fa-user-group',
|
||||
iconOnly: true,
|
||||
}] : []),
|
||||
...(isGlobalTimelineAvailable ? [{
|
||||
key: 'global',
|
||||
title: i18n.ts._timelines.global,
|
||||
icon: 'fas fa-globe',
|
||||
iconOnly: true,
|
||||
}] : []),
|
||||
]);
|
||||
}] : []), {
|
||||
icon: 'fas fa-list-ul',
|
||||
title: i18n.ts.lists,
|
||||
iconOnly: true,
|
||||
loginRequired: true,
|
||||
onClick: chooseList,
|
||||
}, {
|
||||
icon: 'fas fa-satellite',
|
||||
title: i18n.ts.antennas,
|
||||
iconOnly: true,
|
||||
loginRequired: true,
|
||||
onClick: chooseAntenna,
|
||||
}, {
|
||||
icon: 'fas fa-satellite-dish',
|
||||
title: i18n.ts.channel,
|
||||
iconOnly: true,
|
||||
loginRequired: true,
|
||||
onClick: chooseChannel,
|
||||
}]);
|
||||
|
||||
definePageMetadata(computed(() => ({
|
||||
title: i18n.ts.timeline,
|
||||
|
|
|
@ -453,9 +453,6 @@ export const routes = [{
|
|||
path: '/timeline/antenna/:antennaId',
|
||||
component: page(() => import('./pages/antenna-timeline.vue')),
|
||||
loginRequired: true,
|
||||
}, {
|
||||
path: '/timeline',
|
||||
component: page(() => import('./pages/timeline.vue')),
|
||||
}, {
|
||||
name: 'index',
|
||||
path: '/',
|
||||
|
|
Loading…
Reference in a new issue