Просмотр исходного кода

Remove extraneous checks in code for FPU entries

- FPU settings used to be free form text and guard rails needed to be written out manually
- FPU settings now use Pickers which bring data validation earlier and exposed to the user (good things)
- Remove these extra validations which could confusingly override what users select, push that logic to the pickers
Auggie Fisher 1 год назад
Родитель
Сommit
f13676ff6e
1 измененных файлов с 3 добавлено и 6 удалено
  1. 3 6
      FreeAPS/Sources/Modules/MealSettings/MealSettingsStateModel.swift

+ 3 - 6
FreeAPS/Sources/Modules/MealSettings/MealSettingsStateModel.swift

@@ -20,22 +20,19 @@ extension MealSettings {
             subscribeSetting(\.maxFat, on: $maxFat) { maxFat = $0 }
             subscribeSetting(\.maxProtein, on: $maxProtein) { maxProtein = $0 }
             subscribeSetting(\.timeCap, on: $timeCap.map(Int.init), initial: {
-                let value = max(min($0, 12), 5)
-                timeCap = Decimal(value)
+                timeCap = Decimal($0)
             }, map: {
                 $0
             })
 
             subscribeSetting(\.minuteInterval, on: $minuteInterval.map(Int.init), initial: {
-                let value = max(min($0, 60), 10)
-                minuteInterval = Decimal(value)
+                minuteInterval = Decimal($0)
             }, map: {
                 $0
             })
 
             subscribeSetting(\.delay, on: $delay.map(Int.init), initial: {
-                let value = max(min($0, 120), 60)
-                delay = Decimal(value)
+                delay = Decimal($0)
             }, map: {
                 $0
             })