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
@@ -43,3 +43,13 @@ protocol NotificationSettingsServiceType {
/// - completion: The completion of the operation.
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result<Void, Error>) -> Void)?)
}
extension NotificationSettingsServiceType {
func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?) async throws {
try await withCheckedThrowingContinuation { continuation in
updatePushRuleActions(for: ruleId, enabled: enabled, actions: actions) { result in
continuation.resume(with: result)
}
}
}
}