Merge pull request #2192 from creesch/settingSync

Don't access "Notification" if the browser does not support it
This commit is contained in:
Jérémie Astori 2018-03-10 15:24:54 -05:00 committed by GitHub
commit 6857c5dd08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,7 +150,7 @@ function applySetting(name, value) {
autocompletion.disable(); autocompletion.disable();
} }
} else if (name === "desktopNotifications") { } else if (name === "desktopNotifications") {
if (value && Notification.permission !== "granted") { if (("Notification" in window) && value && Notification.permission !== "granted") {
Notification.requestPermission(updateDesktopNotificationStatus); Notification.requestPermission(updateDesktopNotificationStatus);
} else if (!value) { } else if (!value) {
$warningBlocked.hide(); $warningBlocked.hide();