vikunja-frontend/src/helpers/playPop.js
2021-01-30 21:45:54 +01:00

11 lines
No EOL
311 B
JavaScript

export const playSoundWhenDoneKey = 'playSoundWhenTaskDone'
export const playPop = () => {
const enabled = localStorage.getItem(playSoundWhenDoneKey) === 'true' || localStorage.getItem(playSoundWhenDoneKey) === null
if(!enabled) {
return
}
const popSound = new Audio('/audio/pop.wav')
popSound.play()
}