Skip to content

Commit

Permalink
fix(frontend): withSensitiveフィルタ周りの挙動修正 (#14884)
Browse files Browse the repository at this point in the history
* fix(frontend): withSensitiveフィルタ周りの挙動修正

* Update MkNote.vue
  • Loading branch information
kakkokari-gtyih authored Nov 2, 2024
1 parent 224bbd4 commit d57b8bf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
15 changes: 9 additions & 6 deletions packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,18 @@ function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: false): boolean | 'sensitiveMute';
*/
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly = false): boolean | 'sensitiveMute' {
if (mutedWords == null) return false;

if (checkWordMute(noteToCheck, $i, mutedWords)) return true;
if (noteToCheck.reply && checkWordMute(noteToCheck.reply, $i, mutedWords)) return true;
if (noteToCheck.renote && checkWordMute(noteToCheck.renote, $i, mutedWords)) return true;
if (mutedWords != null) {
if (checkWordMute(noteToCheck, $i, mutedWords)) return true;
if (noteToCheck.reply && checkWordMute(noteToCheck.reply, $i, mutedWords)) return true;
if (noteToCheck.renote && checkWordMute(noteToCheck.renote, $i, mutedWords)) return true;
}

if (checkOnly) return false;

if (inTimeline && !tl_withSensitive.value && noteToCheck.files?.some((v) => v.isSensitive)) return 'sensitiveMute';
if (inTimeline && tl_withSensitive.value === false && noteToCheck.files?.some((v) => v.isSensitive)) {
return 'sensitiveMute';
}

return false;
}

Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/components/MkTimeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const props = withDefaults(defineProps<{
}>(), {
withRenotes: true,
withReplies: false,
withSensitive: true,
onlyFiles: false,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div :class="$style.tl">
<MkTimeline
ref="tlComponent"
:key="src + withRenotes + withReplies + onlyFiles"
:key="src + withRenotes + withReplies + onlyFiles + withSensitive"
:src="src.split(':')[0]"
:list="src.split(':')[1]"
:withRenotes="withRenotes"
Expand Down

0 comments on commit d57b8bf

Please sign in to comment.