From 7837852149f4d2c232ec461cbc9e32ee7df0b22b Mon Sep 17 00:00:00 2001
From: Hazelnoot <acomputerdog@gmail.com>
Date: Fri, 11 Oct 2024 11:25:10 -0400
Subject: copy `iAmModerator` check to other instance-info controls

---
 packages/frontend/src/pages/instance-info.vue | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'packages/frontend/src/pages/instance-info.vue')

diff --git a/packages/frontend/src/pages/instance-info.vue b/packages/frontend/src/pages/instance-info.vue
index a2a60a1d5b..469b052b61 100644
--- a/packages/frontend/src/pages/instance-info.vue
+++ b/packages/frontend/src/pages/instance-info.vue
@@ -337,6 +337,7 @@ async function resumeDelivery(): Promise<void> {
 }
 
 async function toggleNSFW(): Promise<void> {
+	if (!iAmModerator) return;
 	if (!instance.value) throw new Error('No instance?');
 	await misskeyApi('admin/federation/update-instance', {
 		host: instance.value.host,
@@ -345,6 +346,7 @@ async function toggleNSFW(): Promise<void> {
 }
 
 async function toggleRejectReports(): Promise<void> {
+	if (!iAmModerator) return;
 	if (!instance.value) throw new Error('No instance?');
 	await misskeyApi('admin/federation/update-instance', {
 		host: instance.value.host,
@@ -364,6 +366,7 @@ function refreshMetadata(): void {
 }
 
 async function deleteAllFiles(): Promise<void> {
+	if (!iAmModerator) return;
 	if (!instance.value) throw new Error('No instance?');
 
 	const confirm = await os.confirm({
@@ -383,6 +386,7 @@ async function deleteAllFiles(): Promise<void> {
 }
 
 async function severAllFollowRelations(): Promise<void> {
+	if (!iAmModerator) return;
 	if (!instance.value) throw new Error('No instance?');
 
 	const confirm = await os.confirm({
-- 
cgit v1.2.3-freya

