From fd58c8517d3c9246f7b8bbfcc1fc8e62edab5c82 Mon Sep 17 00:00:00 2001 From: T0mstone Date: Thu, 15 Jun 2023 17:04:42 +0200 Subject: [PATCH] Fix repeating event reminder --- .../com/simplemobiletools/calendar/pro/extensions/Context.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt index ad7a1f3e8..e3487a8b4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calendar/pro/extensions/Context.kt @@ -334,7 +334,8 @@ fun Context.notifyEvent(originalEvent: Event) { val events = eventsHelper.getRepeatableEventsFor(currentSeconds - WEEK_SECONDS, currentSeconds + YEAR_SECONDS, event.id!!) for (currEvent in events) { eventStartTS = if (currEvent.getIsAllDay()) Formatter.getDayStartTS(Formatter.getDayCodeFromTS(currEvent.startTS)) else currEvent.startTS - if (eventStartTS - currEvent.reminder1Minutes * 60 > currentSeconds) { + val firstReminderMinutes = arrayOf(currEvent.reminder3Minutes, currEvent.reminder2Minutes, currEvent.reminder1Minutes).filter { it != REMINDER_OFF }.max() + if (eventStartTS - firstReminderMinutes * 60 > currentSeconds) { break }