Explorar o código

Add custom array to ensure treatment option order

Deniz Cengiz hai 1 ano
pai
achega
3761d99b30
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      Trio Watch App Extension/Views/TreatmentMenuView.swift

+ 6 - 1
Trio Watch App Extension/Views/TreatmentMenuView.swift

@@ -5,7 +5,12 @@ struct TreatmentMenuView: View {
     @Binding var selectedTreatment: TreatmentOption?
     var onSelect: () -> Void // Callback to handle selection and dismiss the sheet
 
-    let treatments = TreatmentOption.allCases
+    // Define in array to achieve custom order of treatment options
+    let treatments: [TreatmentOption] = [
+        .meal, // First
+        .bolus, // Second
+        .mealBolusCombo // Third
+    ]
 
     private var is40mm: Bool {
         let size = WKInterfaceDevice.current().screenBounds.size