allow SkMutedNote to not recurse for word mutes
This commit is contained in:
parent
57b9988c81
commit
8652a4c63b
2 changed files with 32 additions and 17 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue