enhance(frontend): センシティブなメディアを開く際に確認ダイアログを出せるように (#14115)

* enhance(frontend): センシティブなメディアを開く際に確認ダイアログを出せるように

* Update Changelog
This commit is contained in:
かっこかり
2024-07-19 09:57:01 +09:00
committed by GitHub
parent 54d0a46378
commit 1f24a8cb5a
10 changed files with 75 additions and 17 deletions

View File

@@ -83,11 +83,21 @@ const url = computed(() => (props.raw || defaultStore.state.loadRawImages)
: props.image.thumbnailUrl,
);
function onclick() {
async function onclick(ev: MouseEvent) {
if (!props.controls) {
return;
}
if (hide.value) {
ev.stopPropagation();
if (props.image.isSensitive && defaultStore.state.confirmWhenRevealingSensitiveMedia) {
const { canceled } = await os.confirm({
type: 'question',
text: i18n.ts.sensitiveMediaRevealConfirm,
});
if (canceled) return;
}
hide.value = false;
}
}