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.

settings_notifications: Use async/await in set_up.

Anders Kaseorgd4c1703e6543
diff --git a/web/src/settings_notifications.ts b/web/src/settings_notifications.ts
index a1619d30bea..627a6dc75c8 100644
--- a/web/src/settings_notifications.ts
+++ b/web/src/settings_notifications.ts
@@ -393,7 +393,8 @@ export function set_up(settings_panel: SettingsPanel): void {
// This is only accessed via the notifications banner, so we
// do not need to do a mobile check here--as that banner is
// not shown in a mobile context anyway.
- void Notification.requestPermission().then((permission) => {
+ void (async () => {
+ const permission = await Notification.requestPermission();
if (permission === "granted") {
update_desktop_notification_banner();
} else if (permission === "denied") {
@@ -403,7 +404,7 @@ export function set_up(settings_panel: SettingsPanel): void {
"noopener noreferrer",
);
}
- });
+ })();
});
set_enable_digest_emails_visibility($container, for_realm_settings);