aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorHJ <spam@hjkos.com>2018-12-13 13:46:57 +0000
committerHJ <spam@hjkos.com>2018-12-13 13:46:57 +0000
commit8e4777ccc6bf72b56a0905ca491c8e0e97fb73cf (patch)
tree53e98662ef34b8bccc845f627c125528c1c1436c /src/components
parente443716bcd616ad61efae161624dd970841a935c (diff)
parenta8521fc8d99ee7ee5142e2c7c642eee0fc14ed93 (diff)
Merge branch 'feature/push-subscriptions' into 'develop'
add service worker and push notifications See merge request pleroma/pleroma-fe!404
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 c9e12708..681ccda8 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -47,6 +47,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') ||
@@ -142,6 +143,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 6cdc82da..3f920de5 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -143,6 +143,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')" >