forked from noxious/client
Fix button sound playing when clicked outside of buttons
This commit is contained in:
parent
a299d5dc55
commit
e38c402266
@ -40,7 +40,7 @@ watch(
|
|||||||
|
|
||||||
// #209: Play sound when a button is pressed
|
// #209: Play sound when a button is pressed
|
||||||
addEventListener('click', (event) => {
|
addEventListener('click', (event) => {
|
||||||
if (event.target !instanceof HTMLButtonElement) {
|
if (!(event.target instanceof HTMLButtonElement)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const audio = new Audio('/assets/music/click-btn.mp3')
|
const audio = new Audio('/assets/music/click-btn.mp3')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user