diff --git a/packages/frontend/src/components/MkNoteSub.vue b/packages/frontend/src/components/MkNoteSub.vue index 7a04494fff..71562d48a0 100644 --- a/packages/frontend/src/components/MkNoteSub.vue +++ b/packages/frontend/src/components/MkNoteSub.vue @@ -202,8 +202,9 @@ async function reply(viaKeyboard = false): Promise { function react(): void { pleaseLogin({ openOnRemote: pleaseLoginContext.value }); showMovedDialog(); - sound.playMisskeySfx('reaction'); if (appearNote.value.reactionAcceptance === 'likeOnly') { + sound.playMisskeySfx('reaction'); + misskeyApi('notes/like', { noteId: appearNote.value.id, override: defaultLike.value, @@ -219,7 +220,18 @@ function react(): void { } } else { blur(); - reactionPicker.show(reactButton.value ?? null, appearNote.value, reaction => { + reactionPicker.show(reactButton.value ?? null, note.value, async (reaction) => { + if (prefer.s.confirmOnReact) { + const confirm = await os.confirm({ + type: 'question', + text: i18n.tsx.reactAreYouSure({ emoji: reaction.replace('@.', '') }), + }); + + if (confirm.canceled) return; + } + + sound.playMisskeySfx('reaction'); + misskeyApi('notes/reactions/create', { noteId: appearNote.value.id, reaction: reaction, diff --git a/packages/frontend/src/components/SkNoteSub.vue b/packages/frontend/src/components/SkNoteSub.vue index d8ec33df3c..ba8511faf1 100644 --- a/packages/frontend/src/components/SkNoteSub.vue +++ b/packages/frontend/src/components/SkNoteSub.vue @@ -219,8 +219,9 @@ async function reply(viaKeyboard = false): Promise { function react(): void { pleaseLogin({ openOnRemote: pleaseLoginContext.value }); showMovedDialog(); - sound.playMisskeySfx('reaction'); if (appearNote.value.reactionAcceptance === 'likeOnly') { + sound.playMisskeySfx('reaction'); + misskeyApi('notes/like', { noteId: appearNote.value.id, override: defaultLike.value, @@ -236,7 +237,18 @@ function react(): void { } } else { blur(); - reactionPicker.show(reactButton.value ?? null, appearNote.value, reaction => { + reactionPicker.show(reactButton.value ?? null, note.value, async (reaction) => { + if (prefer.s.confirmOnReact) { + const confirm = await os.confirm({ + type: 'question', + text: i18n.tsx.reactAreYouSure({ emoji: reaction.replace('@.', '') }), + }); + + if (confirm.canceled) return; + } + + sound.playMisskeySfx('reaction'); + misskeyApi('notes/reactions/create', { noteId: appearNote.value.id, reaction: reaction,