From d48bb31e49c0fb949ce4d6c476821327e7e421da Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 22 Nov 2025 20:18:04 +0000 Subject: [PATCH] fix reaction sound in NoteSub - fixes #1224 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this bug comes from Misskey, and we kept it in SkNoteSub latest Misskey `develop` seems to have reworked the code significantly, so I'm not sure if we want to fix this now, or leave the bug in the 2025.5.½ release and avoid creating extra pain for the subsequent merges --- packages/frontend/src/components/MkNoteSub.vue | 16 ++++++++++++++-- packages/frontend/src/components/SkNoteSub.vue | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) 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,