akkoma-fe/src/services/desktop_notification_utils/desktop_notification_utils.js

7 lines
341 B
JavaScript
Raw Permalink Normal View History

2020-07-12 21:06:45 +00:00
export const showDesktopNotification = (rootState, desktopNotificationOpts) => {
if (!('Notification' in window && window.Notification.permission === 'granted')) return
if (rootState.statuses.notifications.desktopNotificationSilence) { return }
2022-06-23 19:31:30 +00:00
return new window.Notification(desktopNotificationOpts.title, desktopNotificationOpts)
2020-07-12 21:06:45 +00:00
}