1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Do not call Notification.requestPermission() if it is already granted or denied

This function crashes the app on WebOS 1.2, and notifs do not work on WebOS anyway
This commit is contained in:
Vasily 2020-04-24 14:56:22 +03:00
parent ce2c3ad36e
commit 1f8d1184d8

View file

@ -5,7 +5,8 @@ define(['serverNotifications', 'playbackManager', 'events', 'globalize', 'requir
document.removeEventListener('click', onOneDocumentClick); document.removeEventListener('click', onOneDocumentClick);
document.removeEventListener('keydown', onOneDocumentClick); document.removeEventListener('keydown', onOneDocumentClick);
if (window.Notification) { // don't request notification permissions if they're already granted or denied
if (window.Notification && window.Notification.permission === "default") {
/* eslint-disable-next-line compat/compat */ /* eslint-disable-next-line compat/compat */
Notification.requestPermission(); Notification.requestPermission();
} }