hide federation from public local instance info if not mod

This commit is contained in:
ThatOneCalculator 2022-07-25 21:21:40 -07:00
parent bdb4a6321b
commit 13ed4389c1
2 changed files with 16 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey", "name": "misskey",
"version": "12.118.0-calc.3.b4", "version": "12.118.0-calc.4.b4",
"codename": "indigo", "codename": "indigo",
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -94,6 +94,7 @@ import * as os from '@/os';
import number from '@/filters/number'; import number from '@/filters/number';
import { i18n } from '@/i18n'; import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata'; import { definePageMetadata } from '@/scripts/page-metadata';
import { iAmModerator } from '@/account';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
initialTab?: string; initialTab?: string;
@ -111,22 +112,30 @@ const initStats = () => os.api('stats', {
const headerActions = $computed(() => []); const headerActions = $computed(() => []);
const headerTabs = $computed(() => [{ let theTabs = [{
key: 'overview', key: 'overview',
title: i18n.ts.overview, title: i18n.ts.overview,
}, { }, {
key: 'emojis', key: 'emojis',
title: i18n.ts.customEmojis, title: i18n.ts.customEmojis,
icon: 'fas fa-laugh', icon: 'fas fa-laugh',
}, {
key: 'federation',
title: i18n.ts.federation,
icon: 'fas fa-globe',
}, { }, {
key: 'charts', key: 'charts',
title: i18n.ts.charts, title: i18n.ts.charts,
icon: 'fas fa-chart-simple', icon: 'fas fa-chart-simple',
}]); }];
if (iAmModerator) {
theTabs.push(
{
key: 'federation',
title: i18n.ts.federation,
icon: 'fas fa-globe',
},
);
}
let headerTabs = $computed(() => theTabs);
definePageMetadata(computed(() => ({ definePageMetadata(computed(() => ({
title: i18n.ts.instanceInfo, title: i18n.ts.instanceInfo,