aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2018-12-13 00:03:50 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2018-12-13 00:03:50 +0700
commit02c0e15781fa0a499c736e710755e799bfaec77d (patch)
tree0defdd796fb4e42e0e228d912622a6bbcc67db89 /src/components
parentee70ec4c7efb49c08f0a76b6b2694c0e9910978c (diff)
add checkbox to disable web push
Diffstat (limited to 'src/components')
-rw-r--r--src/components/settings/settings.js5
-rw-r--r--src/components/settings/settings.vue12
2 files changed, 17 insertions, 0 deletions
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index 91a2014a..ca8543d1 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -45,6 +45,7 @@ const settings = {
scopeCopyLocal: user.scopeCopy,
scopeCopyDefault: this.$t('settings.values.' + instance.scopeCopy),
stopGifs: user.stopGifs,
+ webPushNotificationsLocal: user.webPushNotifications,
loopSilentAvailable:
// Firefox
Object.getOwnPropertyDescriptor(HTMLVideoElement.prototype, 'mozHasAudio') ||
@@ -134,6 +135,10 @@ const settings = {
},
stopGifs (value) {
this.$store.dispatch('setOption', { name: 'stopGifs', value })
+ },
+ webPushNotificationsLocal (value) {
+ this.$store.dispatch('setOption', { name: 'webPushNotifications', value })
+ if (value) this.$store.dispatch('registerPushNotifications')
}
}
}
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index de506e4d..871735fe 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -128,6 +128,18 @@
</li>
</ul>
</div>
+
+ <div class="setting-item">
+ <h2>{{$t('settings.notifications')}}</h2>
+ <ul class="setting-list">
+ <li>
+ <input type="checkbox" id="webPushNotifications" v-model="webPushNotificationsLocal">
+ <label for="webPushNotifications">
+ {{$t('settings.enable_web_push_notifications')}}
+ </label>
+ </li>
+ </ul>
+ </div>
</div>
<div :label="$t('settings.theme')" >