Fix due date changes not saved on mobile
This commit is contained in:
parent
ff06f808ab
commit
2c6ec6ec35
2 changed files with 44 additions and 26 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Reference in a new issue