Stabilize planner UI, fix reset flow, and force Premium on TestFlight

This commit is contained in:
alexandrev-tibco
2026-02-27 13:09:58 +01:00
parent ae40ec6f09
commit a532afbee6
8 changed files with 327 additions and 89 deletions
+16
View File
@@ -33,3 +33,19 @@ final class MealSlot {
set { mealType = newValue.rawValue }
}
}
extension MealSlot {
static func preferredForDuplicateResolution(_ slots: [MealSlot]) -> MealSlot {
slots.sorted { lhs, rhs in
let lhsHasDish = lhs.dishId != nil
let rhsHasDish = rhs.dishId != nil
if lhsHasDish != rhsHasDish { return lhsHasDish }
let lhsHasEvent = lhs.calendarEventId != nil
let rhsHasEvent = rhs.calendarEventId != nil
if lhsHasEvent != rhsHasEvent { return lhsHasEvent }
return lhs.id.uuidString < rhs.id.uuidString
}.first ?? slots[0]
}
}