Add option to always expand CWs, resolves #137

This commit is contained in:
Laura Hausmann 2023-09-02 22:46:07 +02:00
parent 1348d6e1d0
commit 206e81da10
Signed by: zotan
GPG key ID: D044E84C5BE01605
4 changed files with 13 additions and 1 deletions

View file

@ -2135,3 +2135,4 @@ _cwStyle:
modern: "Modern"
classic: "Classic (Misskey/Foundkey-like)"
alternative: "Alternative (Firefish-like)"
alwaysExpandCws: "Always expand posts with content warnings"

View file

@ -47,6 +47,7 @@ import MkButton from "@/components/MkButton.vue";
import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata";
import { i18n } from "@/i18n";
import { defaultStore } from "@/store";
const props = defineProps<{
noteId: string;
@ -56,7 +57,7 @@ let note = $ref<null | misskey.entities.Note>();
let error = $ref();
let isRenote = $ref(false);
let appearNote = $ref<null | misskey.entities.Note>();
let expandAllCws = $ref(false);
let expandAllCws = $ref(defaultStore.state.alwaysExpandCws);
const prevPagination = {
endpoint: "users/notes" as const,

View file

@ -197,6 +197,9 @@
class="_formBlock"
>{{ i18n.ts.showAdminUpdates }}</FormSwitch
>
<FormSwitch v-model="alwaysExpandCws" class="_formBlock">{{
i18n.ts.alwaysExpandCws
}}</FormSwitch>
<FormSelect v-model="cwStyle" class="_formBlock">
<template #label>{{ i18n.ts.cwStyle }}</template>
@ -331,6 +334,9 @@ const expandOnNoteClick = computed(
const showFixedPostForm = computed(
defaultStore.makeGetterSetter("showFixedPostForm"),
);
const alwaysExpandCws = computed(
defaultStore.makeGetterSetter("alwaysExpandCws"),
);
const numberOfPageCache = computed(
defaultStore.makeGetterSetter("numberOfPageCache"),
);

View file

@ -338,6 +338,10 @@ export const defaultStore = markRaw(
where: "device",
default: "modern" as "modern" | "classic" | "alternative",
},
alwaysExpandCws: {
where: "device",
default: false,
},
}),
);