From bf829422459dd94929fad6a782cdf53465f59921 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 19 Feb 2024 14:53:24 +0000 Subject: [PATCH] hide blocked&c instances when not logged in - fixes 422 --- .../src/server/api/endpoints/federation/instances.ts | 6 ++++++ packages/frontend/src/pages/about.federation.vue | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/federation/instances.ts b/packages/backend/src/server/api/endpoints/federation/instances.ts index 6d8ae7c02d..77eb8e5f77 100644 --- a/packages/backend/src/server/api/endpoints/federation/instances.ts +++ b/packages/backend/src/server/api/endpoints/federation/instances.ts @@ -100,6 +100,12 @@ export default class extends Endpoint { // eslint- default: query.orderBy('instance.id', 'DESC'); break; } + if (me == null) { + ps.blocked = false; + ps.suspended = false; + ps.silenced = false; + } + if (typeof ps.blocked === 'boolean') { const meta = await this.metaService.fetch(true); if (ps.blocked) { diff --git a/packages/frontend/src/pages/about.federation.vue b/packages/frontend/src/pages/about.federation.vue index 9ed6ea8623..95895d1c9e 100644 --- a/packages/frontend/src/pages/about.federation.vue +++ b/packages/frontend/src/pages/about.federation.vue @@ -19,9 +19,9 @@ SPDX-License-Identifier: AGPL-3.0-only - - - + + + @@ -60,6 +60,7 @@ import MkPagination, { Paging } from '@/components/MkPagination.vue'; import MkInstanceCardMini from '@/components/MkInstanceCardMini.vue'; import FormSplit from '@/components/form/split.vue'; import { i18n } from '@/i18n.js'; +import { $i } from '@/account.js'; const host = ref(''); const state = ref('federating');