extra safety check in toggleSuspended

if the instance is `softwareSuspended` (i.e. it's running code that we
don't want to federate with), manually toggling its suspension state
makes little sense

the actual control (`MkSwitch`) was already disabled in this case
This commit is contained in:
dakkar 2025-05-14 13:36:45 +01:00
parent 0d55090f0b
commit e0e9719555

View file

@ -325,6 +325,8 @@ async function toggleMediaSilenced(): Promise<void> {
async function toggleSuspended(): Promise<void> {
if (!iAmModerator) return;
if (!instance.value) throw new Error('No instance?');
if (suspensionState.value === 'softwareSuspended') return;
suspensionState.value = isSuspended.value ? 'manuallySuspended' : 'none';
await misskeyApi('admin/federation/update-instance', {
host: instance.value.host,