1
0

Fix due date changes not saved on mobile

This commit is contained in:
kolaente
2020-10-03 14:30:26 +02:00
parent ff06f808ab
commit 2c6ec6ec35
2 changed files with 44 additions and 26 deletions

View File

@ -142,6 +142,11 @@ export default class TaskModel extends AbstractModel {
return
}
if (typeof navigator.serviceWorker === 'undefined') {
console.debug('Service Worker not available')
return
}
const registration = await navigator.serviceWorker.getRegistration()
if (typeof registration === 'undefined') {
return
@ -157,6 +162,10 @@ export default class TaskModel extends AbstractModel {
}
async scheduleNotification(date) {
if (typeof navigator.serviceWorker === 'undefined') {
console.debug('Service Worker not available')
return
}
if (date < new Date()) {
console.debug('Date is in the past, not scheduling a notification. Date is ', date)