From ea01b50b32a81b73b7868009615555a75cd38d49 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 29 Jun 2021 14:46:28 +0200 Subject: [PATCH] Don't show webpush section if navigator.serviceWorker is undefined Signed-off-by: Thomas Citharel --- js/src/views/Settings/Notifications.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/views/Settings/Notifications.vue b/js/src/views/Settings/Notifications.vue index 0d63241f..210b0ad7 100644 --- a/js/src/views/Settings/Notifications.vue +++ b/js/src/views/Settings/Notifications.vue @@ -686,7 +686,7 @@ export default class Notifications extends Vue { } async checkCanShowWebPush(): Promise { - if (!window.isSecureContext && !("serviceWorker" in navigator)) + if (!window.isSecureContext || !("serviceWorker" in navigator)) return Promise.resolve(false); const registration = await navigator.serviceWorker.getRegistration(); return registration !== undefined;