New notification settings

This commit is contained in:
2018-03-15 21:08:30 +01:00
parent 90021ef2f6
commit e0e8ed7996
6 changed files with 108 additions and 10 deletions

View File

@ -2,14 +2,18 @@ import { AnimeNotifier } from "../AnimeNotifier"
// Enable notifications
export async function enableNotifications(arn: AnimeNotifier, button: HTMLElement) {
arn.statusMessage.showInfo("Enabling push notifications...")
await arn.pushManager.subscribe(arn.user.dataset.id)
arn.updatePushUI()
arn.statusMessage.showInfo("Enabled push notifications for this device.")
}
// Disable notifications
export async function disableNotifications(arn: AnimeNotifier, button: HTMLElement) {
arn.statusMessage.showInfo("Disabling push notifications...")
await arn.pushManager.unsubscribe(arn.user.dataset.id)
arn.updatePushUI()
arn.statusMessage.showInfo("Disabled push notifications for this device.")
}
// Test notification