fix notification crash on ios (#2192)
* fix notification crash for ios * access notification from window variable * fix Notification check * catch notification variable error * fix missing check for Notification
This commit is contained in:
@@ -217,3 +217,10 @@ export const syntaxErrorPosition = (error: SyntaxError): number | undefined => {
|
||||
if (Number.isNaN(position)) return undefined;
|
||||
return position;
|
||||
};
|
||||
|
||||
export const notificationPermission = (permission: NotificationPermission) => {
|
||||
if ('Notification' in window) {
|
||||
return window.Notification.permission === permission;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user