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:
Ajay Bura 2025-02-10 21:02:33 +11:00 committed by GitHub
parent 5460e4922b
commit b12228ee95
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 31 additions and 14 deletions

View file

@ -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;
};