Auto-select newly created or imported profile

This commit is contained in:
世界
2025-12-07 18:12:47 +08:00
parent 9b25243b6a
commit 2da9397ef6
3 changed files with 28 additions and 11 deletions
@@ -143,7 +143,9 @@
lastUpdated = Date(timeIntervalSince1970: Double(content.lastUpdated))
}
let uniqueProfileName = try await ProfileManager.uniqueName(content.name)
try await ProfileManager.create(Profile(name: uniqueProfileName, type: type, path: profileConfig.relativePath, remoteURL: content.remotePath, autoUpdate: content.autoUpdate, lastUpdated: lastUpdated))
let profile = Profile(name: uniqueProfileName, type: type, path: profileConfig.relativePath, remoteURL: content.remotePath, autoUpdate: content.autoUpdate, lastUpdated: lastUpdated)
try await ProfileManager.create(profile)
await SharedPreferences.selectedProfileID.set(profile.mustID)
await reset()
await MainActor.run {
environments.profileUpdate.send()