simplify access to showSoftWordMutedWord

This commit is contained in:
Hazelnoot 2025-05-12 13:39:12 -04:00
parent 5cb0129c49
commit 1a3c6f25a2
6 changed files with 6 additions and 12 deletions

View file

@ -176,7 +176,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkUserName :user="appearNote.user"/>
</template>
</I18n>
<I18n v-else-if="showSoftWordMutedWord !== true" :src="i18n.ts.userSaysSomething" tag="small">
<I18n v-else-if="prefer.s.showSoftWordMutedWord" :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkUserName :user="appearNote.user"/>
</template>
@ -329,7 +329,6 @@ const isDeleted = ref(false);
const renoted = ref(false);
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hardMutedWords, true));
const showSoftWordMutedWord = computed(() => prefer.s.showSoftWordMutedWord);
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
const translating = ref(false);
const showTicker = (prefer.s.instanceTicker === 'always') || (prefer.s.instanceTicker === 'remote' && appearNote.value.user.instance);

View file

@ -235,7 +235,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkUserName :user="appearNote.user"/>
</template>
</I18n>
<I18n v-else-if="showSoftWordMutedWord !== true" :src="i18n.ts.userSaysSomething" tag="small">
<I18n v-else-if="prefer.s.showSoftWordMutedWord" :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
<MkUserName :user="appearNote.user"/>
@ -378,7 +378,6 @@ const renoteTooltip = computeRenoteTooltip(renoted);
const inTimeline = inject<boolean>('inTimeline', false);
const tl_withSensitive = inject<Ref<boolean>>('tl_withSensitive', ref(true));
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const showSoftWordMutedWord = computed(() => prefer.s.showSoftWordMutedWord);
/* Overload FunctionLint
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: true): boolean;

View file

@ -78,7 +78,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkUserName :user="appearNote.user"/>
</template>
</I18n>
<I18n v-else-if="showSoftWordMutedWord !== true" :src="i18n.ts.userSaysSomething" tag="small">
<I18n v-else-if="prefer.s.showSoftWordMutedWord" :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkUserName :user="appearNote.user"/>
</template>
@ -186,7 +186,6 @@ async function removeReply(id: Misskey.entities.Note['id']) {
const inTimeline = inject<boolean>('inTimeline', false);
const tl_withSensitive = inject<Ref<boolean>>('tl_withSensitive', ref(true));
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const showSoftWordMutedWord = computed(() => prefer.s.showSoftWordMutedWord);
/* Overload FunctionLint
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: true): boolean;

View file

@ -177,7 +177,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkUserName :user="appearNote.user"/>
</template>
</I18n>
<I18n v-else-if="showSoftWordMutedWord !== true" :src="i18n.ts.userSaysSomething" tag="small">
<I18n v-else-if="prefer.s.showSoftWordMutedWord" :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkUserName :user="appearNote.user"/>
</template>
@ -329,7 +329,6 @@ const isDeleted = ref(false);
const renoted = ref(false);
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hardMutedWords, true));
const showSoftWordMutedWord = computed(() => prefer.s.showSoftWordMutedWord);
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
const translating = ref(false);
const showTicker = (prefer.s.instanceTicker === 'always') || (prefer.s.instanceTicker === 'remote' && appearNote.value.user.instance);

View file

@ -240,7 +240,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkUserName :user="appearNote.user"/>
</template>
</I18n>
<I18n v-else-if="showSoftWordMutedWord !== true" :src="i18n.ts.userSaysSomething" tag="small">
<I18n v-else-if="prefer.s.showSoftWordMutedWord" :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
<MkUserName :user="appearNote.user"/>
@ -384,7 +384,6 @@ const renoteTooltip = computeRenoteTooltip(renoted);
const inTimeline = inject<boolean>('inTimeline', false);
const tl_withSensitive = inject<Ref<boolean>>('tl_withSensitive', ref(true));
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const showSoftWordMutedWord = computed(() => prefer.s.showSoftWordMutedWord);
/* Overload FunctionLint
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: true): boolean;

View file

@ -86,7 +86,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkUserName :user="appearNote.user"/>
</template>
</I18n>
<I18n v-else-if="showSoftWordMutedWord !== true" :src="i18n.ts.userSaysSomething" tag="small">
<I18n v-else-if="prefer.s.showSoftWordMutedWord" :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkUserName :user="appearNote.user"/>
</template>
@ -200,7 +200,6 @@ async function removeReply(id: Misskey.entities.Note['id']) {
const inTimeline = inject<boolean>('inTimeline', false);
const tl_withSensitive = inject<Ref<boolean>>('tl_withSensitive', ref(true));
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
const showSoftWordMutedWord = computed(() => prefer.s.showSoftWordMutedWord);
/* Overload FunctionLint
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: true): boolean;