diff --git a/supacode/Features/Settings/Reducer/SettingsFeature.swift b/supacode/Features/Settings/Reducer/SettingsFeature.swift index 93ecdb09..0020b278 100644 --- a/supacode/Features/Settings/Reducer/SettingsFeature.swift +++ b/supacode/Features/Settings/Reducer/SettingsFeature.swift @@ -359,17 +359,9 @@ struct SettingsFeature { state.dockBadgeAuthorization = authorization return .none - case .showNotificationPermissionAlert(let errorMessage): - let message: String - if let errorMessage, !errorMessage.isEmpty { - message = - "Prowl cannot send system notifications.\n\n" - + "Error: \(errorMessage)" - } else { - message = "Prowl cannot send system notifications while permission is denied." - } + case .showNotificationPermissionAlert: state.alert = AlertState { - TextState("Enable Notifications in System Settings") + TextState("Prowl cannot send system notifications") } actions: { ButtonState(action: .openSystemNotificationSettings) { TextState("Open System Settings") @@ -378,7 +370,9 @@ struct SettingsFeature { TextState("Cancel") } } message: { - TextState(message) + TextState( + "Notification permission is turned off. Open System Settings to allow Prowl to send notifications." + ) } return .none diff --git a/supacodeTests/AppFeatureSystemNotificationTests.swift b/supacodeTests/AppFeatureSystemNotificationTests.swift index a7a9482e..d767332d 100644 --- a/supacodeTests/AppFeatureSystemNotificationTests.swift +++ b/supacodeTests/AppFeatureSystemNotificationTests.swift @@ -43,7 +43,7 @@ struct AppFeatureSystemNotificationTests { $0.settings.systemNotificationsEnabled = false } let expectedAlert = AlertState { - TextState("Enable Notifications in System Settings") + TextState("Prowl cannot send system notifications") } actions: { ButtonState(action: .openSystemNotificationSettings) { TextState("Open System Settings") @@ -52,7 +52,7 @@ struct AppFeatureSystemNotificationTests { TextState("Cancel") } } message: { - TextState("Prowl cannot send system notifications.\n\nError: Mock request error") + TextState("Notification permission is turned off. Open System Settings to allow Prowl to send notifications.") } await store.receive(\.settings.showNotificationPermissionAlert) { $0.settings.alert = expectedAlert @@ -96,7 +96,7 @@ struct AppFeatureSystemNotificationTests { $0.settings.systemNotificationsEnabled = false } let expectedAlert = AlertState { - TextState("Enable Notifications in System Settings") + TextState("Prowl cannot send system notifications") } actions: { ButtonState(action: .openSystemNotificationSettings) { TextState("Open System Settings") @@ -105,7 +105,7 @@ struct AppFeatureSystemNotificationTests { TextState("Cancel") } } message: { - TextState("Prowl cannot send system notifications.\n\nError: Authorization status is denied.") + TextState("Notification permission is turned off. Open System Settings to allow Prowl to send notifications.") } await store.receive(\.settings.showNotificationPermissionAlert) { $0.settings.alert = expectedAlert