From 4576680531c8032f31b751e75877d42b2d2ba508 Mon Sep 17 00:00:00 2001 From: Graeme Arthur Date: Fri, 6 Oct 2023 15:55:56 +0200 Subject: [PATCH] Only show one connection notification at a time --- Core/NetworkProtectionNotificationIdentifier.swift | 4 +--- .../NetworkProtectionUNNotificationPresenter.swift | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Core/NetworkProtectionNotificationIdentifier.swift b/Core/NetworkProtectionNotificationIdentifier.swift index 66a29dcebd..20e1a7631a 100644 --- a/Core/NetworkProtectionNotificationIdentifier.swift +++ b/Core/NetworkProtectionNotificationIdentifier.swift @@ -20,9 +20,7 @@ import Foundation public enum NetworkProtectionNotificationIdentifier: String { - case reconnecting = "network-protection.notification.reconnecting" - case reconnected = "network-protection.notification.reconnected" - case connectionFailure = "network-protection.notification.connection-failure" + case connection = "network-protection.notification.connection" case superseded = "network-protection.notification.superseded" case test = "network-protection.notification.test" } diff --git a/PacketTunnelProvider/NetworkProtection/NetworkProtectionUNNotificationPresenter.swift b/PacketTunnelProvider/NetworkProtection/NetworkProtectionUNNotificationPresenter.swift index 6fa45b93ea..28358d72c8 100644 --- a/PacketTunnelProvider/NetworkProtection/NetworkProtectionUNNotificationPresenter.swift +++ b/PacketTunnelProvider/NetworkProtection/NetworkProtectionUNNotificationPresenter.swift @@ -84,23 +84,22 @@ final class NetworkProtectionUNNotificationPresenter: NSObject, NetworkProtectio body = UserText.networkProtectionConnectionSuccessNotificationBody } let content = notificationContent(body: body) - showNotification(.reconnected, content) + showNotification(.connection, content) } func showConnectionNotification(serverLocation: String?) { - let content = notificationContent(body: UserText.networkProtectionConnectionSuccessNotificationBody) - showNotification(.reconnected, content) + showNotification(.connection, content) } func showReconnectingNotification() { let content = notificationContent(body: UserText.networkProtectionConnectionInterruptedNotificationBody) - showNotification(.reconnecting, content) + showNotification(.connection, content) } func showConnectionFailureNotification() { let content = notificationContent(body: UserText.networkProtectionConnectionFailureNotificationBody) - showNotification(.connectionFailure, content) + showNotification(.connection, content) } func showSupersededNotification() {