From b164e95290c358bb64df0edf99f031bdfae1725b Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 4 Nov 2019 16:11:17 +0200 Subject: [PATCH] Remove DOM access from webpush --- client/components/Windows/Settings.vue | 18 +++- client/js/webpush.js | 114 +++++++++++-------------- 2 files changed, 62 insertions(+), 70 deletions(-) diff --git a/client/components/Windows/Settings.vue b/client/components/Windows/Settings.vue index 129b8258..d324f1ef 100644 --- a/client/components/Windows/Settings.vue +++ b/client/components/Windows/Settings.vue @@ -232,11 +232,21 @@ id="pushNotifications" type="button" class="btn" - :disabled="$store.state.pushNotificationState !== 'supported'" - data-text-alternate="Unsubscribe from push notifications" + :disabled=" + $store.state.pushNotificationState !== 'supported' && + $store.state.pushNotificationState !== 'subscribed' + " @click="onPushButtonClick" > - Subscribe to push notifications + + +
Warning: Push notifications are only supported over @@ -257,9 +267,9 @@