diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts
index 4c83b78c91..76a0d2bd00 100644
--- a/packages/client/src/account.ts
+++ b/packages/client/src/account.ts
@@ -16,6 +16,8 @@ const data = localStorage.getItem('account');
// TODO: 外部からはreadonlyに
export const $i = data ? reactive(JSON.parse(data) as Account) : null;
+export const iAmModerator = $i != null && ($i.isAdmin || $i.isModerator);
+
export async function signout() {
waiting();
localStorage.removeItem('account');
@@ -197,10 +199,3 @@ export async function openAccountMenu(ev: MouseEvent) {
align: 'left'
});
}
-
-// このファイルに書きたくないけどここに書かないと何故かVeturが認識しない
-declare module '@vue/runtime-core' {
- interface ComponentCustomProperties {
- $i: typeof $i;
- }
-}
diff --git a/packages/client/src/pages/instance-info.vue b/packages/client/src/pages/instance-info.vue
index 475107ab6d..fa36db0659 100644
--- a/packages/client/src/pages/instance-info.vue
+++ b/packages/client/src/pages/instance-info.vue
@@ -28,7 +28,7 @@
Moderation
{{ $ts.stopActivityDelivery }}
- {{ $ts.blockThisInstance }}
+ {{ $ts.blockThisInstance }}
@@ -104,15 +104,14 @@
-
diff --git a/packages/client/src/scripts/get-user-menu.ts b/packages/client/src/scripts/get-user-menu.ts
index ebe101bc0f..7b910a0083 100644
--- a/packages/client/src/scripts/get-user-menu.ts
+++ b/packages/client/src/scripts/get-user-menu.ts
@@ -5,7 +5,7 @@ import * as Acct from 'misskey-js/built/acct';
import * as os from '@/os';
import { userActions } from '@/store';
import { router } from '@/router';
-import { $i } from '@/account';
+import { $i, iAmModerator } from '@/account';
export function getUserMenu(user) {
const meId = $i ? $i.id : null;
@@ -175,7 +175,7 @@ export function getUserMenu(user) {
action: reportAbuse
}]);
- if ($i && ($i.isAdmin || $i.isModerator)) {
+ if (iAmModerator) {
menu = menu.concat([null, {
icon: 'fas fa-microphone-slash',
text: user.isSilenced ? i18n.locale.unsilence : i18n.locale.silence,