Explorar el Código

Adjust delete message; disable swipe for FPU entries when setting disabled

Deniz Cengiz hace 1 año
padre
commit
f02ab33d98

+ 2 - 3
FreeAPS/Sources/Modules/Adjustments/AdjustmentsStateModel+Extensions/AdjustmentsStateModel+Overrides.swift

@@ -189,13 +189,12 @@ extension Adjustments.StateModel {
     func updateLatestOverrideConfiguration() {
         Task { [weak self] in
             guard let self = self else { return }
-            
+
             let id = await self.overrideStorage.loadLatestOverrideConfigurations(fetchLimit: 1)
-            
+
             // execute sequentially instead of concurrently
             await self.updateLatestOverrideConfigurationOfState(from: id)
             await self.setCurrentOverride(from: id)
-            
         }
     }
 

+ 4 - 2
FreeAPS/Sources/Modules/DataTable/View/DataTableRootView.swift

@@ -597,7 +597,7 @@ extension DataTable {
                                 NSLocalizedString(" g", comment: "gram of carbs")
                         } else {
                             alertTitle = "Delete Carb Equivalents?"
-                            alertMessage = "All FPUs of the meal will be deleted."
+                            alertMessage = "All FPUs and the carbs of the meal will be deleted."
                         }
 
                         isRemoveHistoryItemAlertPresented = true
@@ -612,7 +612,9 @@ extension DataTable {
                         state.carbEntryToEdit = meal
                         state.showCarbEntryEditor = true
                     }
-                ).tint(.blue)
+                )
+                .tint(!state.settingsManager.settings.useFPUconversion && meal.isFPU ? Color(.systemGray4) : Color.blue)
+                .disabled(!state.settingsManager.settings.useFPUconversion && meal.isFPU)
             }
             .alert(
                 Text(NSLocalizedString(alertTitle, comment: "")),

+ 2 - 2
FreeAPS/Sources/Modules/Home/HomeStateModel+Setup/GlucoseTargetSetup.swift

@@ -78,9 +78,9 @@ extension Home.StateModel {
             )
         }
 
-        //TODO: - remove this after bug is fixed
+        // TODO: - remove this after bug is fixed
         debugPrint("\(DebuggingIdentifiers.inProgress) printing target profiles: \(targetProfiles)")
-        
+
         return targetProfiles
     }
 }

+ 3 - 3
FreeAPS/Sources/Modules/NightscoutConfig/NightscoutConfigStateModel.swift

@@ -89,17 +89,17 @@ extension NightscoutConfig {
                 let fixedURL = url.dropLast()
                 url = String(fixedURL)
             }
-            
+
             guard let url = URL(string: url), self.url.hasPrefix("https://") else {
                 message = "Invalid URL"
                 isValidURL = false
                 return
             }
-            
+
             connecting = true
             isValidURL = true
             message = ""
-            
+
             provider.checkConnection(url: url, secret: secret.isEmpty ? nil : secret)
                 .receive(on: DispatchQueue.main)
                 .sink { completion in