From 010812ef060a3963a8aa0b1d8ea37ddc1b6dd393 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 9 Feb 2020 13:12:54 +0100 Subject: [PATCH] Don't try to cancel notifications if the browser does not support it --- src/models/task.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/models/task.js b/src/models/task.js index 0253f1ab50..9ceae186b8 100644 --- a/src/models/task.js +++ b/src/models/task.js @@ -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