Bugfix: wrong Notification.RequestAborted

This commit is contained in:
djmaze 2021-04-22 23:53:39 +02:00
parent ffb2f64170
commit 999389c6c5
2 changed files with 2 additions and 1 deletions

View file

@ -5,6 +5,7 @@ import { isPosNumeric, delegateRunOnDestroy, mailToHelper } from 'Common/UtilsUs
import {
Capa,
Notification,
Scope
} from 'Common/Enums';

View file

@ -7,7 +7,7 @@ import * as Links from 'Common/Links';
/**
* Might not work due to the new ServiceWorkerRegistration.showNotification
*/
const HTML5Notification = window.Notification ? Notification : null,
const HTML5Notification = window.Notification,
HTML5NotificationStatus = () => (HTML5Notification && HTML5Notification.permission) || 'denied',
NotificationsDenied = () => 'denied' === HTML5NotificationStatus(),
NotificationsGranted = () => 'granted' === HTML5NotificationStatus(),