mirror of
https://github.com/passepartoutvpn/passepartout-apple.git
synced 2025-02-17 21:32:05 +00:00
Fix active profile not always cleared on deletion
Was only cleared if deleted profile was current profile.
This commit is contained in:
parent
dc66f514d9
commit
10537c5a29
@ -335,10 +335,6 @@ extension ProfileManager {
|
|||||||
// IMPORTANT: invalidate current profile if deleted
|
// IMPORTANT: invalidate current profile if deleted
|
||||||
if !currentProfile.value.isPlaceholder && !newHeaders.keys.contains(currentProfile.value.id) {
|
if !currentProfile.value.isPlaceholder && !newHeaders.keys.contains(currentProfile.value.id) {
|
||||||
pp_log.info("\tCurrent profile deleted, invalidating...")
|
pp_log.info("\tCurrent profile deleted, invalidating...")
|
||||||
if isCurrentProfileActive() {
|
|
||||||
pp_log.info("\tCurrent profile was also active, deactivating...")
|
|
||||||
activeProfileId = nil
|
|
||||||
}
|
|
||||||
currentProfile.value = .placeholder
|
currentProfile.value = .placeholder
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,6 +344,11 @@ extension ProfileManager {
|
|||||||
currentProfile.value = newProfile
|
currentProfile.value = newProfile
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let activeProfileId = activeProfileId, !newHeaders.keys.contains(activeProfileId) {
|
||||||
|
pp_log.info("\tActive profile was deleted")
|
||||||
|
self.activeProfileId = nil
|
||||||
|
}
|
||||||
|
|
||||||
// IMPORTANT: defer task to avoid recursive saves
|
// IMPORTANT: defer task to avoid recursive saves
|
||||||
// FIXME: Core Data, not sure about this workaround
|
// FIXME: Core Data, not sure about this workaround
|
||||||
Task {
|
Task {
|
||||||
|
Loading…
Reference in New Issue
Block a user