mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-16 01:56:36 +03:00
13 lines
314 B
JavaScript
13 lines
314 B
JavaScript
export const sendNotification = (title, body = '', image = '') => {
|
|
checkForNotificationPermission()
|
|
new Notification(title, {
|
|
body: body,
|
|
icon: image,
|
|
silent: true,
|
|
})
|
|
}
|
|
|
|
const checkForNotificationPermission = () => {
|
|
return 'Notification' in window && Notification.permission === 'granted'
|
|
}
|