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
Dominik Pschenitschni 943e554a58
All checks were successful
continuous-integration/drone/push Build is passing
feat: improve playPop helper (#1229)
Co-authored-by: Dominik Pschenitschni <mail@celement.de>
Reviewed-on: #1229
Reviewed-by: konrad <k@knt.li>
Co-authored-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
Co-committed-by: Dominik Pschenitschni <dpschen@noreply.kolaente.de>
2021-12-21 17:56:48 +00:00

13 lines
298 B
TypeScript

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