merge: Disabling cat speak on the client (!609)

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

Closes #604

Approved-by: fEmber <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Marie 2024-10-03 19:51:35 +00:00
commit aedc5fba81
7 changed files with 15 additions and 3 deletions

View file

@ -58,8 +58,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
provide('linkNavigationBehavior', props.linkNavigationBehavior);
const isNote = props.isNote ?? true;
const shouldNyaize = props.nyaize ? props.nyaize === 'respect' ? props.author?.isCat ? props.author.speakAsCat : false : false : false;
const shouldNyaize = props.nyaize === 'respect' && props.author?.isCat && props.author?.speakAsCat && !defaultStore.state.disableCatSpeak;
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (props.text == null || props.text === '') return;

View file

@ -68,6 +68,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="showGapBetweenNotesInTimeline">{{ i18n.ts.showGapBetweenNotesInTimeline }}</MkSwitch>
<MkSwitch v-model="loadRawImages">{{ i18n.ts.loadRawImages }}</MkSwitch>
<MkSwitch v-model="showTickerOnReplies">{{ i18n.ts.showTickerOnReplies }}</MkSwitch>
<MkSwitch v-model="disableCatSpeak">{{ i18n.ts.disableCatSpeak }}</MkSwitch>
<MkSelect v-model="searchEngine" placeholder="Other">
<template #label>{{ i18n.ts.searchEngine }}</template>
<option
@ -400,6 +401,7 @@ const disableShowingAnimatedImages = computed(defaultStore.makeGetterSetter('dis
const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds'));
const oneko = computed(defaultStore.makeGetterSetter('oneko'));
const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages'));
const disableCatSpeak = computed(defaultStore.makeGetterSetter('disableCatSpeak'));
const highlightSensitiveMedia = computed(defaultStore.makeGetterSetter('highlightSensitiveMedia'));
const imageNewTab = computed(defaultStore.makeGetterSetter('imageNewTab'));
const enableFaviconNotificationDot = computed(defaultStore.makeGetterSetter('enableFaviconNotificationDot'));

View file

@ -77,6 +77,7 @@ const defaultStoreSaveKeys: (keyof typeof defaultStore['state'])[] = [
'enableFaviconNotificationDot',
'imageNewTab',
'dataSaver',
'disableCatSpeak',
'disableShowingAnimatedImages',
'emojiStyle',
'disableDrawer',

View file

@ -288,6 +288,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device',
default: window.matchMedia('(prefers-reduced-motion)').matches,
},
disableCatSpeak: {
where: 'account',
default: false,
},
emojiStyle: {
where: 'device',
default: 'twemoji', // twemoji / fluentEmoji / native