navidrome/ui/src/utils/notifications.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
314 B
JavaScript
Raw Normal View History

2020-11-19 23:06:09 -05:00
export const sendNotification = (title, body = '', image = '') => {
checkForNotificationPermission()
new Notification(title, {
body: body,
icon: image,
2020-11-19 23:22:18 -05:00
silent: true,
2020-11-19 23:06:09 -05:00
})
}
const checkForNotificationPermission = () => {
return 'Notification' in window && Notification.permission === 'granted'
}