aboutsummaryrefslogtreecommitdiff
path: root/src/services/push/push.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/services/push/push.js')
-rw-r--r--src/services/push/push.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/services/push/push.js b/src/services/push/push.js
index 7d99648a..28954948 100644
--- a/src/services/push/push.js
+++ b/src/services/push/push.js
@@ -1,4 +1,3 @@
-
function urlBase64ToUint8Array (base64String) {
const padding = '='.repeat((4 - base64String.length % 4) % 4)
const base64 = (base64String + padding)
@@ -46,6 +45,10 @@ function askPermission () {
}
function subscribe (registration, store) {
+ if (!store.rootState.config.webPushNotifications) {
+ return Promise.reject(new Error('Web Push is disabled in config'))
+ }
+
if (!store.rootState.instance.vapidPublicKey) {
return Promise.reject(new Error('VAPID publick key is not found'))
}