From 1f8d1184d8387695ee7e164286e7673b644c05f7 Mon Sep 17 00:00:00 2001 From: Vasily Date: Fri, 24 Apr 2020 14:56:22 +0300 Subject: [PATCH] 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 --- src/components/notifications/notifications.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 8ba870613b..4b00171aee 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -5,7 +5,8 @@ define(['serverNotifications', 'playbackManager', 'events', 'globalize', 'requir document.removeEventListener('click', 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 */ Notification.requestPermission(); }