Skip to content

Commit

Permalink
Only show one connection notification at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme committed Oct 6, 2023
1 parent c7f07e2 commit 4576680
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions Core/NetworkProtectionNotificationIdentifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 4576680

Please sign in to comment.