fix: 🔒 Remove timeline source if not logged in and guest tl isn't enabled
This commit is contained in:
parent
0ef9dd3519
commit
4f0030ecc8
2 changed files with 13 additions and 12 deletions
|
@ -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<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) });
|
||||
let src = $computed({ get: () => ($i ? defaultStore.reactiveState.tl.value.src : srcWhenNotSignin), set: (x) => saveSrc(x) });
|
||||
if (!enableGuestTimeline) {
|
||||
src = $computed({});
|
||||
}
|
||||
|
||||
watch ($$(src), () => queue = 0);
|
||||
|
||||
|
|
|
@ -6,18 +6,15 @@ import MkError from '@/pages/_error_.vue';
|
|||
import { api } from '@/os';
|
||||
import { ui } from '@/config';
|
||||
|
||||
const meta = api('meta', {
|
||||
function getGuestTimelineStatus() {
|
||||
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);
|
||||
});
|
||||
}).then((meta) => {
|
||||
return meta.enableGuestTimeline;
|
||||
});
|
||||
}
|
||||
|
||||
const guestTimeline = true;
|
||||
const guestTimeline = getGuestTimelineStatus();
|
||||
|
||||
const page = (loader: AsyncComponentLoader<any>) => defineAsyncComponent({
|
||||
loader: loader,
|
||||
|
|
Loading…
Reference in a new issue