2021-12-21 18:56:48 +01:00
|
|
|
import popSoundFile from '@/assets/audio/pop.mp3'
|
|
|
|
|
|
|
|
export const playSoundWhenDoneKey = 'playSoundWhenTaskDone'
|
|
|
|
|
|
|
|
export function playPop() {
|
2022-02-26 14:48:46 +01:00
|
|
|
const enabled = localStorage.getItem(playSoundWhenDoneKey) === 'true'
|
|
|
|
if (!enabled) {
|
2021-12-21 18:56:48 +01:00
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2022-02-26 14:48:46 +01:00
|
|
|
playPopSound()
|
|
|
|
}
|
|
|
|
|
|
|
|
export function playPopSound() {
|
2021-12-21 18:56:48 +01:00
|
|
|
const popSound = new Audio(popSoundFile)
|
|
|
|
popSound.play()
|
2022-02-26 14:48:46 +01:00
|
|
|
}
|