1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +02:00

First pass at linting lib dir

This commit is contained in:
Laurent Cozic
2019-07-29 15:43:53 +02:00
parent 64b7bc3d62
commit 86dc72b204
170 changed files with 4140 additions and 3119 deletions

View File

@ -2,7 +2,6 @@ const Note = require('lib/models/Note.js');
const Alarm = require('lib/models/Alarm.js');
class AlarmService {
static setDriver(v) {
this.driver_ = v;
}
@ -40,7 +39,7 @@ class AlarmService {
await Alarm.batchDelete(alarmIds);
}
// When passing a note, make sure it has all the required properties
// When passing a note, make sure it has all the required properties
// (better to pass a complete note or else just the ID)
static async updateNoteNotification(noteOrId, isDeleted = false) {
try {
@ -62,14 +61,12 @@ class AlarmService {
let alarm = noteId ? await Alarm.byNoteId(noteId) : null;
let clearAlarm = false;
if (isDeleted ||
!Note.needAlarm(note) ||
(alarm && alarm.trigger_time !== note.todo_due))
{
if (isDeleted || !Note.needAlarm(note) || (alarm && alarm.trigger_time !== note.todo_due)) {
clearAlarm = !!alarm;
}
if (!clearAlarm && alarm) { // Alarm already exists and set at the right time
if (!clearAlarm && alarm) {
// Alarm already exists and set at the right time
// For persistent notifications (those that stay active after the app has been closed, like on mobile), if we have
// an alarm object we can be sure that the notification has already been set, so there's nothing to do.
@ -118,7 +115,6 @@ class AlarmService {
await this.updateNoteNotification(dueNotes[i]);
}
}
}
module.exports = AlarmService;
module.exports = AlarmService;