Don't try to cancel notifications if the browser does not support it
This commit is contained in:
parent
80b363872e
commit
010812ef06
1 changed files with 5 additions and 0 deletions
|
@ -145,6 +145,11 @@ export default class TaskModel extends AbstractModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
async cancelScheduledNotifications() {
|
async cancelScheduledNotifications() {
|
||||||
|
if (!('showTrigger' in Notification.prototype)) {
|
||||||
|
console.debug('This browser does not support triggered notifications')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const registration = await navigator.serviceWorker.getRegistration()
|
const registration = await navigator.serviceWorker.getRegistration()
|
||||||
if (typeof registration === 'undefined') {
|
if (typeof registration === 'undefined') {
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue