Add updatePushActions(for:enabled:standardActions) method

This commit is contained in:
Alfonso Grillo 2022-12-02 12:41:31 +01:00
parent eae9b2fcc3
commit 96e01efaf7

View file

@ -114,8 +114,14 @@ final class NotificationSettingsViewModel: NotificationSettingsViewModelType, Ob
case .keywords: // Keywords is handled differently to other settings
updateKeywords(isChecked: isChecked)
default:
updatePushActions(for: [ruleID], enabled: enabled, standardActions: standardActions)
}
}
private func updatePushActions(for ids: [NotificationPushRuleId], enabled: Bool, standardActions: NotificationStandardActions) {
for id in ids {
notificationSettingsService.updatePushRuleActions(
for: ruleID.rawValue,
for: id.rawValue,
enabled: enabled,
actions: standardActions.actions
)