Skip to content

Commit d57b8bf

Browse files
fix(frontend): withSensitiveフィルタ周りの挙動修正 (#14884)
* fix(frontend): withSensitiveフィルタ周りの挙動修正 * Update MkNote.vue
1 parent 224bbd4 commit d57b8bf

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

packages/frontend/src/components/MkNote.vue

+9-6
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,18 @@ function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string
292292
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: false): boolean | 'sensitiveMute';
293293
*/
294294
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly = false): boolean | 'sensitiveMute' {
295-
if (mutedWords == null) return false;
296-
297-
if (checkWordMute(noteToCheck, $i, mutedWords)) return true;
298-
if (noteToCheck.reply && checkWordMute(noteToCheck.reply, $i, mutedWords)) return true;
299-
if (noteToCheck.renote && checkWordMute(noteToCheck.renote, $i, mutedWords)) return true;
295+
if (mutedWords != null) {
296+
if (checkWordMute(noteToCheck, $i, mutedWords)) return true;
297+
if (noteToCheck.reply && checkWordMute(noteToCheck.reply, $i, mutedWords)) return true;
298+
if (noteToCheck.renote && checkWordMute(noteToCheck.renote, $i, mutedWords)) return true;
299+
}
300300

301301
if (checkOnly) return false;
302302

303-
if (inTimeline && !tl_withSensitive.value && noteToCheck.files?.some((v) => v.isSensitive)) return 'sensitiveMute';
303+
if (inTimeline && tl_withSensitive.value === false && noteToCheck.files?.some((v) => v.isSensitive)) {
304+
return 'sensitiveMute';
305+
}
306+
304307
return false;
305308
}
306309

packages/frontend/src/components/MkTimeline.vue

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ const props = withDefaults(defineProps<{
4343
}>(), {
4444
withRenotes: true,
4545
withReplies: false,
46+
withSensitive: true,
4647
onlyFiles: false,
4748
});
4849

packages/frontend/src/pages/timeline.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
1717
<div :class="$style.tl">
1818
<MkTimeline
1919
ref="tlComponent"
20-
:key="src + withRenotes + withReplies + onlyFiles"
20+
:key="src + withRenotes + withReplies + onlyFiles + withSensitive"
2121
:src="src.split(':')[0]"
2222
:list="src.split(':')[1]"
2323
:withRenotes="withRenotes"

0 commit comments

Comments
 (0)