allow SkMutedNote to not recurse for word mutes

This commit is contained in:
Hazelnoot 2025-06-30 13:33:56 -04:00
parent 57b9988c81
commit 8652a4c63b
2 changed files with 32 additions and 17 deletions

View file

@ -86,10 +86,12 @@ import { checkMute } from '@/utility/check-word-mute.js';
const props = withDefaults(defineProps<{
note: Misskey.entities.Note;
withHardMute?: boolean;
dive?: boolean;
mutedClass?: string | string[] | Record<string, boolean> | (string | string[] | Record<string, boolean>)[];
expandedClass?: string | string[] | Record<string, boolean> | (string | string[] | Record<string, boolean>)[];
}>(), {
withHardMute: true,
dive: true,
mutedClass: undefined,
expandedClass: undefined,
});
@ -105,7 +107,12 @@ function expand() {
emit('expandMute', props.note);
}
const mute = checkMute(computed(() => props.note), computed(() => props.withHardMute));
const mute = checkMute(
computed(() => props.note),
computed(() => props.withHardMute),
computed(() => props.dive),
);
const mutedWords = computed(() => mute.value.softMutedWords?.join(', '));
const isExpanded = computed(() => expandNote.value || !mute.value.hasMute);
const rootClass = computed(() => isExpanded.value ? props.expandedClass : undefined);