Skip to content

Commit

Permalink
Merge pull request #22 from vicolo-dev/bug-weekly-schedule
Browse files Browse the repository at this point in the history
Fix weekly schedule not getting enabled after disabling
  • Loading branch information
AhsanSarwar45 authored Dec 16, 2023
2 parents 3629063 + f8bab0d commit 145c5c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/alarm/types/schedules/weekly_alarm_schedule.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class WeeklyAlarmSchedule extends AlarmSchedule {

WeekdaySchedule get nextWeekdaySchedule {
if (_weekdaySchedules.isEmpty) return WeekdaySchedule(0);
if (_weekdaySchedules.any((weeklySchedule) =>
weeklySchedule.alarmRunner.currentScheduleDateTime == null)) {
return _weekdaySchedules[0];
}
return _weekdaySchedules.reduce((a, b) => a
.alarmRunner.currentScheduleDateTime!
.isBefore(b.alarmRunner.currentScheduleDateTime!)
Expand Down

0 comments on commit 145c5c0

Please sign in to comment.