Ver código fonte

Nother back button commit

Jon Mårtensson 2 anos atrás
pai
commit
fd5e02d7f5

+ 3 - 14
FreeAPS/Sources/Modules/Bolus/View/AlternativeBolusCalcRootView.swift

@@ -63,15 +63,6 @@ extension Bolus {
                 }
 
                 Section {
-                    if !fetch {
-                        Button {
-                            carbssView()
-                        }
-                        label: { Text("Add Meal") }.frame(maxWidth: .infinity, alignment: .center)
-                    }
-                } header: { Text(!fetch ? "Meal Summary" : "") }
-
-                Section {
                     HStack {
                         Button(action: {
                             showInfo.toggle()
@@ -138,7 +129,7 @@ extension Bolus {
                             }
                         }
                     }
-                } header: { Text("Bolus Summary") }
+                } header: { Text("Bolus") }
 
                 if state.amount > 0 {
                     Section {
@@ -169,11 +160,9 @@ extension Bolus {
             .navigationBarTitleDisplayMode(.inline)
             .navigationBarItems(
                 leading: Button {
-                    if fetch {
-                        carbssView()
-                    }
+                    carbssView()
                 }
-                label: { Text(fetch ? "Back" : "") },
+                label: { Text(fetch ? "Back" : "Meal") },
 
                 trailing: Button { state.hideModal() }
                 label: { Text("Close") }

+ 3 - 15
FreeAPS/Sources/Modules/Bolus/View/DefaultBolusCalcRootView.swift

@@ -42,15 +42,6 @@ extension Bolus {
                 }
 
                 Section {
-                    if !fetch {
-                        Button {
-                            carbssView()
-                        }
-                        label: { Text("Add Meal") }.frame(maxWidth: .infinity, alignment: .center)
-                    }
-                } header: { Text(!fetch ? "Meal Summary" : "") }
-
-                Section {
                     if state.waitForSuggestion {
                         HStack {
                             Text("Wait please").foregroundColor(.secondary)
@@ -93,8 +84,7 @@ extension Bolus {
                             Text(!(state.amount > state.maxBolus) ? "U" : "😵").foregroundColor(.secondary)
                         }
                     }
-                }
-                header: { Text("Bolus Summary") }
+                } header: { Text("Bolus") }
 
                 if !state.waitForSuggestion {
                     if state.amount > 0 {
@@ -153,11 +143,9 @@ extension Bolus {
             .navigationBarTitleDisplayMode(.inline)
             .navigationBarItems(
                 leading: Button {
-                    if fetch {
-                        carbssView()
-                    }
+                    carbssView()
                 }
-                label: { Text(fetch ? "Back" : "") },
+                label: { Text(fetch ? "Back" : "Meal") },
 
                 trailing: Button { state.hideModal() }
                 label: { Text("Close") }