[F] Make oneTime a computed property

This commit is contained in:
Hykilpikonna
2021-01-24 12:33:03 -05:00
parent 4256eb45e8
commit f8f01c0bcb
3 changed files with 6 additions and 8 deletions
@@ -62,7 +62,6 @@ class AddAlarmViewController: UIViewController
(0...6).forEach { alarm.repeats[$0] = false }
if repeatWeekdaysSwitch.isOn { (1...5).forEach { alarm.repeats[$0] = true } }
if repeatWeekendsSwitch.isOn { [0, 6].forEach { alarm.repeats[$0] = true } }
if (alarm.repeats.allSatisfy { !$0 }) { alarm.oneTime = true }
// Add the alarm to the list and save the list
Alarms.fromLocal().apply { $0.list.append(alarm) }.localSave();