Activate first created profile

This commit is contained in:
Davide De Rosa 2022-07-15 17:45:42 +02:00
parent 58e375ec41
commit dec7fb9030
1 changed files with 8 additions and 8 deletions

View File

@ -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)