Improved push notifications

This commit is contained in:
2017-07-15 01:32:06 +02:00
parent 92a540e024
commit 460d90d957
7 changed files with 78 additions and 22 deletions

View File

@ -215,13 +215,15 @@ export function search(arn: AnimeNotifier, search: HTMLInputElement, e: Keyboard
}
// Enable notifications
export function enableNotifications(arn: AnimeNotifier, button: HTMLElement) {
arn.pushManager.subscribe(arn.user.dataset.id)
export async function enableNotifications(arn: AnimeNotifier, button: HTMLElement) {
await arn.pushManager.subscribe(arn.user.dataset.id)
arn.updatePushUI()
}
// Disable notifications
export function disableNotifications(arn: AnimeNotifier, button: HTMLElement) {
arn.pushManager.unsubscribe(arn.user.dataset.id)
export async function disableNotifications(arn: AnimeNotifier, button: HTMLElement) {
await arn.pushManager.unsubscribe(arn.user.dataset.id)
arn.updatePushUI()
}
// Test notification