From 7837852149f4d2c232ec461cbc9e32ee7df0b22b Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Fri, 11 Oct 2024 11:25:10 -0400 Subject: [PATCH] copy `iAmModerator` check to other instance-info controls --- packages/frontend/src/pages/instance-info.vue | 4 ++++ 1 file changed, 4 insertions(+) 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 { } async function toggleNSFW(): Promise { + 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 { } async function toggleRejectReports(): Promise { + 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 { + if (!iAmModerator) return; if (!instance.value) throw new Error('No instance?'); const confirm = await os.confirm({ @@ -383,6 +386,7 @@ async function deleteAllFiles(): Promise { } async function severAllFollowRelations(): Promise { + if (!iAmModerator) return; if (!instance.value) throw new Error('No instance?'); const confirm = await os.confirm({