Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

js: Fix operator precedence issues #237

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions public/js/notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,19 @@ 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) {
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 +38,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
Loading