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