diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 21fc8080f5..c6a9a9c1bc 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -38,6 +38,7 @@ const XTutorial = defineAsyncComponent(() => import('./timeline.tutorial.vue')); const isLocalTimelineAvailable = !instance.disableLocalTimeline || ($i != null && ($i.isModerator || $i.isAdmin)); const isRecommendedTimelineAvailable = !instance.disableRecommendedTimeline || ($i != null && ($i.isModerator || $i.isAdmin)); const isGlobalTimelineAvailable = !instance.disableGlobalTimeline || ($i != null && ($i.isModerator || $i.isAdmin)); +const enableGuestTimeline = instance.enableGuestTimeline; const keymap = { 't': focus, }; @@ -47,7 +48,10 @@ const rootEl = $ref(); 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) }); +let src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) }); +if (!enableGuestTimeline) { + src = $computed({}); +} watch ($$(src), () => queue = 0); diff --git a/packages/client/src/router.ts b/packages/client/src/router.ts index 4f1c9dc899..2112c7aeb2 100644 --- a/packages/client/src/router.ts +++ b/packages/client/src/router.ts @@ -6,18 +6,15 @@ import MkError from '@/pages/_error_.vue'; import { api } from '@/os'; import { ui } from '@/config'; -const meta = api('meta', { - detail: false -}).then((meta) => { - console.log(meta); - console.log(meta[0]); - console.log(meta[1]); - console.log(meta[0][0]); - // const guestTimeline = meta.enableGuestTimeline; - // console.log(guestTimeline); -}); +function getGuestTimelineStatus() { + api('meta', { + detail: false + }).then((meta) => { + return meta.enableGuestTimeline; + }); +} -const guestTimeline = true; +const guestTimeline = getGuestTimelineStatus(); const page = (loader: AsyncComponentLoader) => defineAsyncComponent({ loader: loader,