notifications: Use NotificationAPI for permission_state.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2020-04-26 16:09:42 -07:00 committed by Tim Abbott
parent f277eb022c
commit 549ed3913c
1 changed files with 2 additions and 2 deletions

View File

@ -91,12 +91,12 @@ function update_notification_sound_source() {
} }
exports.permission_state = function () { exports.permission_state = function () {
if (window.Notification === undefined) { if (NotificationAPI === undefined) {
// act like notifications are blocked if they do not have access to // act like notifications are blocked if they do not have access to
// the notification API. // the notification API.
return "denied"; return "denied";
} }
return window.Notification.permission; return NotificationAPI.permission;
}; };
let new_message_count = 0; let new_message_count = 0;