Fix VPN status not restored on app launch

Notifications deemed not relevant because currentBundleIdentifier
not set unless connect/reinstate.

Assume initial relevant identifier to be the first notified.

See 7ba41a0e73
This commit is contained in:
Davide De Rosa 2022-05-01 22:47:38 +02:00
parent 87f2ebfd9e
commit 7eec20c75b
1 changed files with 6 additions and 0 deletions

View File

@ -180,6 +180,12 @@ extension VPNManager {
}
private func onVPNStatus(_ notification: Notification) {
// assume first notified identifier to be the relevant one
// in order to restore VPN status on app launch
if currentBundleIdentifier == nil {
currentBundleIdentifier = notification.vpnBundleIdentifier
}
guard isRelevantNotification(notification) else {
return
}