Skip to content

Commit

Permalink
Always reloads the login item and VPN extension
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoreymendez committed Dec 22, 2023
1 parent 0bcbae9 commit ad3945d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ final class NetworkProtectionAppEvents {
versionStore.lastVersionRun = currentVersion
}

#if DEBUG
// For debug builds we always want to restart the VPN and VPN menu app to ensure
// the latest is loaded
restartNetworkProtectionTunnelAndMenu(using: loginItemsManager)
#else
// should‘ve been run at least once with NetP enabled
guard let lastVersionRun = versionStore.lastVersionRun else {
os_log(.info, log: .networkProtection, "No last version found for the NetP login items, skipping update")
Expand All @@ -131,6 +136,7 @@ final class NetworkProtectionAppEvents {
os_log(.info, log: .networkProtection, "App updated from %{public}s to %{public}s: updating login items", lastVersionRun, currentVersion)
restartNetworkProtectionTunnelAndMenu(using: loginItemsManager)
}
#endif
}

private func restartNetworkProtectionTunnelAndMenu(using loginItemsManager: LoginItemsManager) {
Expand Down

0 comments on commit ad3945d

Please sign in to comment.