enhance(frontend): リアクション選択時に音を流せるように (#12441)
* (add) リアクション選択時に音を鳴らせるように * Update Changelog * tweak sound * tweak sound --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
		| @@ -163,6 +163,7 @@ import { focusPrev, focusNext } from '@/scripts/focus.js'; | ||||
| import { checkWordMute } from '@/scripts/check-word-mute.js'; | ||||
| import { userPage } from '@/filters/user.js'; | ||||
| import * as os from '@/os.js'; | ||||
| import * as sound from '@/scripts/sound.js'; | ||||
| import { defaultStore, noteViewInterruptors } from '@/store.js'; | ||||
| import { reactionPicker } from '@/scripts/reaction-picker.js'; | ||||
| import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js'; | ||||
| @@ -336,6 +337,8 @@ function react(viaKeyboard = false): void { | ||||
| 	pleaseLogin(); | ||||
| 	showMovedDialog(); | ||||
| 	if (appearNote.reactionAcceptance === 'likeOnly') { | ||||
| 		sound.play('reaction'); | ||||
|  | ||||
| 		if (props.mock) { | ||||
| 			return; | ||||
| 		} | ||||
| @@ -354,6 +357,8 @@ function react(viaKeyboard = false): void { | ||||
| 	} else { | ||||
| 		blur(); | ||||
| 		reactionPicker.show(reactButton.value, reaction => { | ||||
| 			sound.play('reaction'); | ||||
|  | ||||
| 			if (props.mock) { | ||||
| 				emit('reaction', reaction); | ||||
| 				return; | ||||
|   | ||||
| @@ -210,6 +210,7 @@ import { checkWordMute } from '@/scripts/check-word-mute.js'; | ||||
| import { userPage } from '@/filters/user.js'; | ||||
| import { notePage } from '@/filters/note.js'; | ||||
| import * as os from '@/os.js'; | ||||
| import * as sound from '@/scripts/sound.js'; | ||||
| import { defaultStore, noteViewInterruptors } from '@/store.js'; | ||||
| import { reactionPicker } from '@/scripts/reaction-picker.js'; | ||||
| import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm.js'; | ||||
| @@ -369,6 +370,8 @@ function react(viaKeyboard = false): void { | ||||
| 	pleaseLogin(); | ||||
| 	showMovedDialog(); | ||||
| 	if (appearNote.reactionAcceptance === 'likeOnly') { | ||||
| 		sound.play('reaction'); | ||||
|  | ||||
| 		os.api('notes/reactions/create', { | ||||
| 			noteId: appearNote.id, | ||||
| 			reaction: '❤️', | ||||
| @@ -383,6 +386,8 @@ function react(viaKeyboard = false): void { | ||||
| 	} else { | ||||
| 		blur(); | ||||
| 		reactionPicker.show(reactButton.value, reaction => { | ||||
| 			sound.play('reaction'); | ||||
|  | ||||
| 			os.api('notes/reactions/create', { | ||||
| 				noteId: appearNote.id, | ||||
| 				reaction: reaction, | ||||
|   | ||||
| @@ -28,6 +28,7 @@ import MkReactionEffect from '@/components/MkReactionEffect.vue'; | ||||
| import { claimAchievement } from '@/scripts/achievements.js'; | ||||
| import { defaultStore } from '@/store.js'; | ||||
| import { i18n } from '@/i18n.js'; | ||||
| import * as sound from '@/scripts/sound.js'; | ||||
|  | ||||
| const props = defineProps<{ | ||||
| 	reaction: string; | ||||
| @@ -59,6 +60,10 @@ async function toggleReaction() { | ||||
| 		}); | ||||
| 		if (confirm.canceled) return; | ||||
|  | ||||
| 		if (oldReaction !== props.reaction) { | ||||
| 			sound.play('reaction'); | ||||
| 		} | ||||
|  | ||||
| 		if (mock) { | ||||
| 			emit('reactionToggled', props.reaction, (props.count - 1)); | ||||
| 			return; | ||||
| @@ -75,6 +80,8 @@ async function toggleReaction() { | ||||
| 			} | ||||
| 		}); | ||||
| 	} else { | ||||
| 		sound.play('reaction'); | ||||
|  | ||||
| 		if (mock) { | ||||
| 			emit('reactionToggled', props.reaction, (props.count + 1)); | ||||
| 			return; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 かっこかり
					かっこかり