diff --git a/CHANGELOG.md b/CHANGELOG.md index ec62d70c..0d6e4f47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 2.2.1 (2023-10-14) + +### Fixed + +- Persisted profile is overwritten with its former value. [#367](https://github.com/passepartoutvpn/passepartout-apple/issues/367) ## 2.2.0 (2023-10-10) diff --git a/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/ProfileManager.swift b/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/ProfileManager.swift index c7a7f8cb..bcb1aedf 100644 --- a/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/ProfileManager.swift +++ b/PassepartoutLibrary/Sources/PassepartoutVPN/Managers/ProfileManager.swift @@ -371,8 +371,7 @@ extension ProfileManager { currentProfile.value = .placeholder } - let newProfile = profileRepository.profile(withId: currentProfile.value.id) - if let newProfile = newProfile, newProfile != currentProfile.value { + if let newProfile = newProfiles[currentProfile.value.id], newProfile != currentProfile.value { pp_log.info("Current profile remotely updated") currentProfile.value = newProfile }