Merge pull request #3437 from crazyserver/MOBILE-3936

MOBILE-3936 reminders: Fix on undefined checks
main
Dani Palou 2022-11-11 11:44:04 +01:00 committed by GitHub
commit ad66933c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)) {