Address comments and cleanup version checks

This commit is contained in:
David Langley
2021-08-25 15:46:02 +01:00
parent 73b448afb6
commit 9b81730a50
11 changed files with 47 additions and 51 deletions
@@ -104,7 +104,7 @@ final class NotificationSettingsViewModel: NotificationSettingsViewModelType, Ob
// MARK: - Public
func check(ruleID: NotificationPushRuleId, checked: Bool) {
let index = NotificationIndex.index(enabled: checked)
let index = NotificationIndex.index(when: checked)
if ruleID == .keywords {
// Keywords is handled differently to other settings
handleCheckKeywords(checked: checked)
@@ -126,7 +126,7 @@ final class NotificationSettingsViewModel: NotificationSettingsViewModelType, Ob
return
}
// Get the static definition and update the actions and enabled state for every keyword.
let index = NotificationIndex.index(enabled: checked)
let index = NotificationIndex.index(when: checked)
guard let standardActions = NotificationPushRuleId.keywords.standardActions(for: index) else { return }
let enabled = standardActions != .disabled
keywordsSet.forEach { keyword in