瀏覽代碼

Fix missing mmol/L parsing for delete glucose alert #462

Deniz Cengiz 1 年之前
父節點
當前提交
3785ca805a
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      Trio/Sources/Modules/DataTable/View/DataTableRootView.swift

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

@@ -367,10 +367,12 @@ extension DataTable {
                                 action: {
                                     alertGlucoseToDelete = glucose
 
+                                    let glucoseToDisplay = state.units == .mgdL ? glucose.glucose
+                                        .description : Int(glucose.glucose).formattedAsMmolL
                                     alertTitle = String(localized: "Delete Glucose?", comment: "Alert title for deleting glucose")
                                     alertMessage = Formatter.dateFormatter
-                                        .string(from: glucose.date ?? Date()) + ", " +
-                                        (Formatter.decimalFormatterWithTwoFractionDigits.string(for: glucose.glucose) ?? "0")
+                                        .string(from: glucose.date ?? Date()) + ", " + glucoseToDisplay + " " + state.units
+                                        .rawValue
 
                                     isRemoveHistoryItemAlertPresented = true
                                 }