diff --git a/RiotSwiftUI/Modules/Settings/Notifications/Service/Mock/MockNotificationSettingsService.swift b/RiotSwiftUI/Modules/Settings/Notifications/Service/Mock/MockNotificationSettingsService.swift index 7d74f5288c..7154af2a09 100644 --- a/RiotSwiftUI/Modules/Settings/Notifications/Service/Mock/MockNotificationSettingsService.swift +++ b/RiotSwiftUI/Modules/Settings/Notifications/Service/Mock/MockNotificationSettingsService.swift @@ -44,15 +44,13 @@ class MockNotificationSettingsService: NotificationSettingsServiceType, Observab keywords.remove(keyword) } - func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result) -> Void)?) { + func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?) async throws { guard let ruleIndex = rules.firstIndex(where: { $0.ruleId == ruleId }) else { - completion?(.success(())) return } rules[ruleIndex] = MockNotificationPushRule(ruleId: ruleId, enabled: enabled, actions: actions) - completion?(.success(())) } } diff --git a/RiotSwiftUI/Modules/Settings/Notifications/Service/NotificationSettingsServiceType.swift b/RiotSwiftUI/Modules/Settings/Notifications/Service/NotificationSettingsServiceType.swift index 9e6419d230..5b06dfb6de 100644 --- a/RiotSwiftUI/Modules/Settings/Notifications/Service/NotificationSettingsServiceType.swift +++ b/RiotSwiftUI/Modules/Settings/Notifications/Service/NotificationSettingsServiceType.swift @@ -40,16 +40,5 @@ protocol NotificationSettingsServiceType { /// - ruleId: The id of the rule. /// - enabled: Whether the rule should be enabled or disabled. /// - actions: The actions to update with. - /// - completion: The completion of the operation. - func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?, completion: ((Result) -> 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) - } - } - } + func updatePushRuleActions(for ruleId: String, enabled: Bool, actions: NotificationActions?) async throws }