mirror of
https://github.com/abhinavxd/libredesk.git
synced 2026-09-22 02:23:32 +00:00
eb0a7b437d
- fix duplicate initialization guard - notification bell for agents - Refactor and clean up dead code - Fixes to pre chat form - Add new column country to users table - Update ratelimit pkg to be generic
17 lines
333 B
JavaScript
17 lines
333 B
JavaScript
import notificationSound from '../assets/notification.mp3'
|
|
|
|
let audio = null
|
|
|
|
export function initAudioContext() {
|
|
if (audio) return
|
|
audio = new Audio(notificationSound)
|
|
audio.volume = 0.5
|
|
audio.load()
|
|
}
|
|
|
|
export function playNotificationSound() {
|
|
if (!audio) return
|
|
audio.currentTime = 0
|
|
audio.play().catch(() => {})
|
|
}
|