diff options
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/settings/settings.js | 5 | ||||
| -rw-r--r-- | src/components/settings/settings.vue | 12 |
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')" > |
