Refine poll push rule sync logic

This commit is contained in:
Alfonso Grillo
2023-01-30 11:53:32 +01:00
parent 4474f5beab
commit c9d39b25f3
2 changed files with 20 additions and 9 deletions
@@ -187,16 +187,17 @@ private extension NotificationSettingsViewModel {
notificationSettingsService.updatePushRuleActions(
for: id.rawValue,
enabled: enabled,
actions: standardActions.actions) { [weak self] result in
switch result {
case .success:
#warning("TODO: sync the update of these rules with the completion")
self?.updatePushActions(for: rules, enabled: enabled, standardActions: standardActions)
completion?(.success(()))
case .failure(let error):
completion?(.failure(error))
}
actions: standardActions.actions
) { [weak self] result in
switch result {
case .success:
#warning("TODO: sync the update of these rules with the completion")
self?.updatePushActions(for: rules, enabled: enabled, standardActions: standardActions)
completion?(.success(()))
case .failure(let error):
completion?(.failure(error))
}
}
}
func updatePushActions(for ids: [NotificationPushRuleId], enabled: Bool, standardActions: NotificationStandardActions) {