This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/src/helpers/playPop.ts

18 lines
354 B
TypeScript

import popSoundFile from '@/assets/audio/pop.mp3'
export const playSoundWhenDoneKey = 'playSoundWhenTaskDone'
export function playPop() {
const enabled = localStorage.getItem(playSoundWhenDoneKey) === 'true'
if (!enabled) {
return
}
playPopSound()
}
export function playPopSound() {
const popSound = new Audio(popSoundFile)
popSound.play()
}