fix: notification cause crash on android (#2938)

fix notification cause crash on android
This commit is contained in:
Ajay Bura 2026-05-15 16:30:23 +10:00 committed by GitHub
commit 909aa430b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -233,7 +233,15 @@ export const notificationPermission = (permission: NotificationPermission) => {
if ('Notification' in window) {
return window.Notification.permission === permission;
}
try {
// https://stackoverflow.com/questions/29774836/failed-to-construct-notification-illegal-constructor
// https://issues.chromium.org/issues/40415865
// eslint-disable-next-line no-new
new Notification('');
} catch {
return false;
}
return true;
};
export const getMouseEventCords = (event: MouseEvent) => ({