Skip to content

Commit 1ce2edf

Browse files
authored
Merge pull request #425 from loopandlearn/honor-global-snooze
Fix: Honor the global "Snooze All" setting
2 parents 2b391f5 + 91a1c7f commit 1ce2edf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

LoopFollow/Alarm/AlarmManager.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@ class AlarmManager {
4343
func checkAlarms(data: AlarmData) {
4444
let now = Date()
4545
var alarmTriggered = false
46+
47+
let config = Storage.shared.alarmConfiguration.value
48+
49+
// Honor the "Snooze All" setting. If active, stop any current alarm and exit.
50+
if let snoozeUntil = config.snoozeUntil, snoozeUntil > now {
51+
if Observable.shared.currentAlarm.value != nil {
52+
stopAlarm()
53+
}
54+
return
55+
}
56+
4657
let alarms = Storage.shared.alarms.value
4758

4859
let sorted = alarms.sorted(by: Alarm.byPriorityThenSpec)

0 commit comments

Comments
 (0)