fix: notification cause crash on android (#2938)
fix notification cause crash on android
This commit is contained in:
@@ -233,7 +233,15 @@ export const notificationPermission = (permission: NotificationPermission) => {
|
||||
if ('Notification' in window) {
|
||||
return window.Notification.permission === permission;
|
||||
}
|
||||
return false;
|
||||
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) => ({
|
||||
|
||||
Reference in New Issue
Block a user