frontend: リモートユーザーのユーザーページではクリップなどの連合しないものを表示できないように

This commit is contained in:
okayurisotto 2024-10-25 20:49:36 +09:00 committed by kakkokari-gtyih
parent 8076f78d06
commit 258b1d68c6

View file

@ -94,51 +94,28 @@ watch(() => props.acct, fetchUser, {
const headerActions = computed(() => []);
const headerTabs = computed(() => user.value ? [{
key: 'home',
title: i18n.ts.overview,
icon: 'ti ti-home',
}, {
key: 'notes',
title: i18n.ts.notes,
icon: 'ti ti-pencil',
}, {
key: 'activity',
title: i18n.ts.activity,
icon: 'ti ti-chart-line',
}, ...(user.value.host == null ? [{
key: 'achievements',
title: i18n.ts.achievements,
icon: 'ti ti-medal',
}] : []), ...($i && ($i.id === user.value.id || $i.isAdmin || $i.isModerator)) || user.value.publicReactions ? [{
key: 'reactions',
title: i18n.ts.reaction,
icon: 'ti ti-mood-happy',
}] : [], {
key: 'clips',
title: i18n.ts.clips,
icon: 'ti ti-paperclip',
}, {
key: 'lists',
title: i18n.ts.lists,
icon: 'ti ti-list',
}, {
key: 'pages',
title: i18n.ts.pages,
icon: 'ti ti-news',
}, {
key: 'flashs',
title: 'Play',
icon: 'ti ti-player-play',
}, {
key: 'gallery',
title: i18n.ts.gallery,
icon: 'ti ti-icons',
}, {
key: 'raw',
title: 'Raw',
icon: 'ti ti-code',
}] : []);
const headerTabs = computed(() => {
if (user.value == null) return [];
const isReactionsVisible = user.value.publicReactions || ($i && ($i.id === user.value.id || $i.isAdmin || $i.isModerator));
const isLocalUser = user.value.host === null;
return [
{ key: 'home', title: i18n.ts.overview, icon: 'ti ti-home' },
{ key: 'notes', title: i18n.ts.notes, icon: 'ti ti-pencil' },
{ key: 'activity', title: i18n.ts.activity, icon: 'ti ti-chart-line', },
...(isLocalUser ? [{ key: 'achievements', title: i18n.ts.achievements, icon: 'ti ti-medal' }] : []),
...(isReactionsVisible ? [{ key: 'reactions', title: i18n.ts.reaction, icon: 'ti ti-mood-happy' }] : []),
...(isLocalUser ? [
{ key: 'clips', title: i18n.ts.clips, icon: 'ti ti-paperclip' },
{ key: 'lists', title: i18n.ts.lists, icon: 'ti ti-list' },
{ key: 'pages', title: i18n.ts.pages, icon: 'ti ti-news' },
{ key: 'flashs', title: 'Play', icon: 'ti ti-player-play' },
{ key: 'gallery', title: i18n.ts.gallery, icon: 'ti ti-icons' },
] : []),
{ key: 'raw', title: 'Raw', icon: 'ti ti-code' },
];
});
definePageMetadata(() => ({
title: i18n.ts.user,