merge: hide blocked&c instances when not logged in - fixes #422 (!430)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/430

Closes #422

Approved-by: Marie <marie@kaifa.ch>
Approved-by: Amelia Yukii <amelia.yukii@shourai.de>
This commit is contained in:
Marie 2024-02-19 19:09:11 +00:00
commit 3912436f4f
2 changed files with 10 additions and 3 deletions

View file

@ -100,6 +100,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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) {

View file

@ -19,9 +19,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="publishing">{{ i18n.ts.publishing }}</option>
<option value="bubble">Bubble</option>
<option value="nsfw">NSFW</option>
<option value="suspended">{{ i18n.ts.suspended }}</option>
<option value="silenced">{{ i18n.ts.silence }}</option>
<option value="blocked">{{ i18n.ts.blocked }}</option>
<option v-if="$i" value="suspended">{{ i18n.ts.suspended }}</option>
<option v-if="$i" value="silenced">{{ i18n.ts.silence }}</option>
<option v-if="$i" value="blocked">{{ i18n.ts.blocked }}</option>
<option value="notResponding">{{ i18n.ts.notResponding }}</option>
</MkSelect>
<MkSelect v-model="sort">
@ -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');