Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

desktop_notifications: Bring checks into concord.

Karl Stolley1b984356b10e
diff --git a/web/src/desktop_notifications.ts b/web/src/desktop_notifications.ts
index 77fe3b2ecc7..f173173c78f 100644
--- a/web/src/desktop_notifications.ts
+++ b/web/src/desktop_notifications.ts
@@ -84,12 +84,12 @@ export function initialize(): void {
}
export function permission_state(): string {
- if (NotificationAPI === undefined) {
- // act like notifications are blocked if they do not have access to
- // the notification API.
- return "denied";
+ if (NotificationAPI) {
+ return NotificationAPI.permission;
}
- return NotificationAPI.permission;
+ // Act like notifications are blocked if a UA
+ // has no access to the notification API.
+ return "denied";
}
export function close_notification(message: Message): void {
@@ -109,7 +109,7 @@ export async function request_desktop_notifications_permission(): Promise<Notifi
if (NotificationAPI) {
return await NotificationAPI.requestPermission();
}
- // Act like notifications are blocked if they do not have access to
- // the notification API.
+ // Act like notifications are blocked if a UA
+ // has no access to the notification API.
return "denied";
}