This commit is contained in:
2018-03-29 12:14:46 +02:00
parent 91dce1895f
commit ee1460aef7
4 changed files with 46 additions and 34 deletions

View File

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