fix: check if notifications are available at all before checking if triggered are available
Should fix sentry issue FRONTEND-OSS-J
This commit is contained in:
parent
8bbdbe62a4
commit
8389587a60
1 changed files with 4 additions and 4 deletions
|
@ -161,7 +161,7 @@ export default class TaskModel extends AbstractModel {
|
|||
}
|
||||
|
||||
async cancelScheduledNotifications() {
|
||||
if (!('showTrigger' in Notification.prototype)) {
|
||||
if (!(Notification && 'showTrigger' in Notification.prototype)) {
|
||||
console.debug('This browser does not support triggered notifications')
|
||||
return
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ export default class TaskModel extends AbstractModel {
|
|||
return
|
||||
}
|
||||
|
||||
if (!('showTrigger' in Notification.prototype)) {
|
||||
if (!(Notification && 'showTrigger' in Notification.prototype)) {
|
||||
console.debug('This browser does not support triggered notifications')
|
||||
return
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ export default class TaskModel extends AbstractModel {
|
|||
],
|
||||
})
|
||||
console.debug('Notification scheduled for ' + date)
|
||||
} catch(e) {
|
||||
} catch (e) {
|
||||
throw new Error('Error scheduling notification', e)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue