diff --git a/AutoCatCore/Models/Vehicle.swift b/AutoCatCore/Models/Vehicle.swift index a263f9b..062ba9e 100644 --- a/AutoCatCore/Models/Vehicle.swift +++ b/AutoCatCore/Models/Vehicle.swift @@ -374,6 +374,10 @@ public final class Vehicle: Object, Decodable, Identifiable, Differentiable, Clo notes.append(objectsIn: self.notes.map { $0.clone() }) vehicle.notes = notes + let events = List() + events.append(objectsIn: self.events.map { $0.clone() }.sorted { $0.date > $1.date }) + vehicle.events = events + return vehicle }