quintodrome/ui/src/utils/notifications.js

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

13 lines
314 B
JavaScript
Raw Normal View History

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