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

Clean up workspace; remove comma

dnzxy 2 лет назад
Родитель
Сommit
473772db42

+ 1 - 2
FreeAPS/Sources/APS/Storage/PumpHistoryStorage.swift

@@ -44,8 +44,7 @@ final class BasePumpHistoryStorage: PumpHistoryStorage, Injectable {
                         durationMin: nil,
                         rate: nil,
                         temp: nil,
-                        carbInput: nil,
-                        isSMB: dose.automatic
+                        carbInput: nil
                     )]
                 case .tempBasal:
                     guard let dose = event.dose else { return [] }

+ 1 - 5
FreeAPS/Sources/Models/PumpHistoryEvent.swift

@@ -11,7 +11,6 @@ struct PumpHistoryEvent: JSON, Equatable {
     let temp: TempType?
     let carbInput: Int?
     let note: String?
-    let isSMB: Bool?
 
     init(
         id: String,
@@ -23,8 +22,7 @@ struct PumpHistoryEvent: JSON, Equatable {
         rate: Decimal? = nil,
         temp: TempType? = nil,
         carbInput: Int? = nil,
-        note: String? = nil,
-        isSMB: Bool? = nil
+        note: String? = nil
     ) {
         self.id = id
         self.type = type
@@ -36,7 +34,6 @@ struct PumpHistoryEvent: JSON, Equatable {
         self.temp = temp
         self.carbInput = carbInput
         self.note = note
-        self.isSMB = isSMB
     }
 }
 
@@ -83,6 +80,5 @@ extension PumpHistoryEvent {
         case temp
         case carbInput = "carb_input"
         case note
-        case isSMB
     }
 }

+ 8 - 9
FreeAPS/Sources/Modules/DataTable/DataTableDataFlow.swift

@@ -68,7 +68,7 @@ enum DataTable {
         let note: String?
         let isSMB: Bool?
 
-        private var numberFormatter: NumberFormatter {
+        private var numberFormater: NumberFormatter {
             let formatter = NumberFormatter()
             formatter.numberStyle = .decimal
             formatter.maximumFractionDigits = 2
@@ -129,17 +129,16 @@ enum DataTable {
 
             switch type {
             case .carbs:
-                return numberFormatter
+                return numberFormater
                     .string(from: amount as NSNumber)! + NSLocalizedString(" g", comment: "gram of carbs")
             case .fpus:
-                return numberFormatter
+                return numberFormater
                     .string(from: amount as NSNumber)! + NSLocalizedString(" g", comment: "gram of carb equilvalents")
             case .bolus:
-                return numberFormatter
-                    .string(from: amount as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit") +
-                    "\(isSMB ?? false ? " SMB" : "")"
+                return numberFormater
+                    .string(from: amount as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit")
             case .tempBasal:
-                return numberFormatter
+                return numberFormater
                     .string(from: amount as NSNumber)! + NSLocalizedString(" U/hr", comment: "Unit insulin per hour")
             case .tempTarget:
                 var converted = amount
@@ -148,7 +147,7 @@ enum DataTable {
                 }
 
                 guard var secondAmount = secondAmount else {
-                    return numberFormatter.string(from: converted as NSNumber)! + " \(units.rawValue)"
+                    return numberFormater.string(from: converted as NSNumber)! + " \(units.rawValue)"
                 }
                 if units == .mmolL {
                     secondAmount = secondAmount.asMmolL
@@ -183,7 +182,7 @@ enum DataTable {
             guard let duration = duration, duration > 0 else {
                 return nil
             }
-            return numberFormatter.string(from: duration as NSNumber)! + " min"
+            return numberFormater.string(from: duration as NSNumber)! + " min"
         }
     }
 

+ 1 - 2
FreeAPS/Sources/Modules/DataTable/DataTableStateModel.swift

@@ -71,8 +71,7 @@ extension DataTable {
                             type: .bolus,
                             date: $0.timestamp,
                             amount: $0.amount,
-                            idPumpEvent: $0.id,
-                            isSMB: $0.isSMB
+                            idPumpEvent: $0.id
                         )
                     }
 

+ 1 - 1
FreeAPS/Sources/Modules/DataTable/View/DataTableRootView.swift

@@ -113,7 +113,7 @@ extension DataTable {
                 Image(systemName: "circle.fill").foregroundColor(item.color)
                 Text(dateFormatter.string(from: item.date))
                     .moveDisabled(true)
-                Text((item.isSMB ?? false) ? "🤖" : item.type.name)
+                Text(item.type.name)
                 Text(item.amountText).foregroundColor(.secondary)
 
                 if let duration = item.durationText {

+ 1 - 1
FreeAPS/Sources/Services/UserNotifiactions/UserNotificationsManager.swift

@@ -232,7 +232,7 @@ final class BaseUserNotificationsManager: NSObject, UserNotificationsManager, In
             }
         }
     }
-
+    
     private func glucoseText(glucoseValue: Int, delta: Int?, direction: BloodGlucose.Direction?) -> String {
         let units = settingsManager.settings.units
         let glucoseText = glucoseFormatter