Skip to content

Commit

Permalink
js: Fix operator precedence issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nilmerg committed Jul 18, 2024
1 parent f55b0e2 commit 48651d3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions public/js/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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!");
}
Expand Down

0 comments on commit 48651d3

Please sign in to comment.