From 48651d37f44f31e4adc6dcdf0b68107be7e90ad4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 18 Jul 2024 13:38:28 +0200 Subject: [PATCH] js: Fix operator precedence issues --- public/js/notifications.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/js/notifications.js b/public/js/notifications.js index d4c43164..eddbdc3c 100644 --- a/public/js/notifications.js +++ b/public/js/notifications.js @@ -8,25 +8,25 @@ const VERSION = 1; const LOG_PREFIX = '[Notification] - '; - if (! 'ServiceWorker' in self) { + if (! ('ServiceWorker' in self)) { console.error(LOG_PREFIX + "this browser does not support the 'Service Worker API' in the current context"); return; } - if (! 'Navigator' in self) { + if (! ('Navigator' in self)) { console.error(LOG_PREFIX + "this browser does not support the 'Navigator API' in the current context"); return; } - if (! navigator.serviceWorker) { + if (! ('serviceWorker' in navigator)) { console.error(LOG_PREFIX + "this browser does not support the 'Service Worker API' in the current context"); return; } - if (! 'Notification' in self) { + if (! ('Notification' in self)) { console.error(LOG_PREFIX + "this browser does not support the 'Notification API' in the current context"); return; @@ -44,7 +44,7 @@ const VERSION = 1; super(icinga); // only allow to be instantiated in a web context - if (! self instanceof Window) { + if (! (self instanceof Window)) { this.logger.error(LOG_PREFIX + "module should not get loaded outside of a web context!"); throw new Error("Attempted to initialize the 'Notification' module outside of a web context!"); }