1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-24 10:24:15 +02:00

fix(frontend): ファイルタブのセンシティブメディアを開く際に確認ダイアログを出す設定が適用されない問題を修正 (#17019)

* fix(frontend): ファイルタブのセンシティブメディアを開く際に確認ダイアログを出す設定が適用されない問題を修正

* Update Changelog

* refactor

* Update Changelog
This commit is contained in:
かっこかり
2026-01-02 21:41:32 +09:00
committed by GitHub
parent a1ba403f9a
commit 9c22538454
7 changed files with 73 additions and 40 deletions

View File

@@ -77,6 +77,7 @@ import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import { $i, iAmModerator } from '@/i.js';
import { prefer } from '@/preferences.js';
import { shouldHideFileByDefault, canRevealFile } from '@/utility/sensitive-file.js';
const props = withDefaults(defineProps<{
image: Misskey.entities.DriveFile;
@@ -106,12 +107,8 @@ async function reveal(ev: MouseEvent) {
if (hide.value) {
ev.stopPropagation();
if (props.image.isSensitive && prefer.s.confirmWhenRevealingSensitiveMedia) {
const { canceled } = await os.confirm({
type: 'question',
text: i18n.ts.sensitiveMediaRevealConfirm,
});
if (canceled) return;
if (!(await canRevealFile(props.image))) {
return;
}
hide.value = false;
@@ -119,8 +116,8 @@ async function reveal(ev: MouseEvent) {
}
// Plugin:register_note_view_interruptor を使って書き換えられる可能性があるためwatchする
watch(() => props.image, () => {
hide.value = (prefer.s.nsfw === 'force' || prefer.s.dataSaver.media) ? true : (props.image.isSensitive && prefer.s.nsfw !== 'ignore');
watch(() => props.image, (newImage) => {
hide.value = shouldHideFileByDefault(newImage);
}, {
deep: true,
immediate: true,