Fix new profiles not being saved

Broken in #685
This commit is contained in:
Davide De Rosa 2024-10-04 21:28:56 +02:00
parent 38aa83760f
commit d2f44d3ee2
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
1 changed files with 2 additions and 1 deletions

View File

@ -120,7 +120,8 @@ extension ProfileManager {
public func save(_ profile: Profile, isShared: Bool? = nil) async throws {
pp_log(.app, .notice, "Save profile \(profile.id)...")
do {
if let existingProfile = allProfiles[profile.id], profile != existingProfile {
let existingProfile = allProfiles[profile.id]
if existingProfile == nil || profile != existingProfile {
try await beforeSave?(profile)
try await repository.saveEntities([profile])