diff --git a/PassepartoutLibrary/Sources/PassepartoutProfiles/Managers/DefaultProfileManager.swift b/PassepartoutLibrary/Sources/PassepartoutProfiles/Managers/DefaultProfileManager.swift index c7a92e92..cdd7f1d6 100644 --- a/PassepartoutLibrary/Sources/PassepartoutProfiles/Managers/DefaultProfileManager.swift +++ b/PassepartoutLibrary/Sources/PassepartoutProfiles/Managers/DefaultProfileManager.swift @@ -175,18 +175,18 @@ extension DefaultProfileManager { assertionFailure("Placeholder") return } + + let isActive = isActive ?? allHeaders.isEmpty pp_log.info("Writing profile \(profile.logDescription) to persistent store") strategy.saveProfile(profile) - if let isActive = isActive { - if isActive { - pp_log.info("\tActivating profile...") - activeProfileId = profile.id - } else if activeProfileId == profile.id { - pp_log.info("\tDeactivating profile...") - activeProfileId = nil - } + if isActive { + pp_log.info("\tActivating profile...") + activeProfileId = profile.id + } else if activeProfileId == profile.id { + pp_log.info("\tDeactivating profile...") + activeProfileId = nil } // IMPORTANT: refresh live copy if just saved (e.g. via intents)