Add updatePushActions(for:enabled:standardActions) method

This commit is contained in:
Alfonso Grillo
2022-12-02 12:41:31 +01:00
parent d01d9546c0
commit f87be21ab3
@@ -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
)