MOBILE-3936 reminders: Fix on undefined checks

main
Pau Ferrer Ocaña 2022-11-11 11:35:23 +01:00
parent df65afbd5d
commit 5cd929a4ec
1 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ const migrateFromCalendarRemindersV1 = async (db: SQLiteDB): Promise<void> => {
reminderTime = event.timestart - Math.floor(reminderTime / 60) * 60; reminderTime = event.timestart - Math.floor(reminderTime / 60) * 60;
} }
if (typeof uniqueReminder[record.eventid] === undefined) { if (uniqueReminder[record.eventid] === undefined) {
uniqueReminder[record.eventid] = []; uniqueReminder[record.eventid] = [];
} else { } else {
if (uniqueReminder[record.eventid].includes(reminderTime)) { if (uniqueReminder[record.eventid].includes(reminderTime)) {
@ -167,7 +167,7 @@ const migrateFromCalendarRemindersV2 = async (db: SQLiteDB): Promise<void> => {
const reminderTime = record.time || CoreRemindersService.DEFAULT_REMINDER_TIMEBEFORE; const reminderTime = record.time || CoreRemindersService.DEFAULT_REMINDER_TIMEBEFORE;
if (typeof uniqueReminder[record.eventid] === undefined) { if (uniqueReminder[record.eventid] === undefined) {
uniqueReminder[record.eventid] = []; uniqueReminder[record.eventid] = [];
} else { } else {
if (uniqueReminder[record.eventid].includes(reminderTime)) { if (uniqueReminder[record.eventid].includes(reminderTime)) {