瀏覽代碼

fix for treatments sheet not closing after treatment entry

polscm32 aka Marvout 1 年之前
父節點
當前提交
ee0db0f0ec
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

+ 1 - 1
FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

@@ -232,6 +232,7 @@ extension Bolus {
 
 
         @MainActor func invokeTreatmentsTask() {
         @MainActor func invokeTreatmentsTask() {
             Task {
             Task {
+                addButtonPressed = true
                 let isInsulinGiven = amount > 0
                 let isInsulinGiven = amount > 0
                 let isCarbsPresent = carbs > 0
                 let isCarbsPresent = carbs > 0
                 let isFatPresent = fat > 0
                 let isFatPresent = fat > 0
@@ -247,7 +248,6 @@ extension Bolus {
                 }
                 }
 
 
                 await saveMeal()
                 await saveMeal()
-                addButtonPressed = true
 
 
                 // if glucose data is stale end the custom loading animation by hiding the modal
                 // if glucose data is stale end the custom loading animation by hiding the modal
 //                guard glucoseOfLast20Min.first?.date ?? now >= Date().addingTimeInterval(-12.minutes.timeInterval) else {
 //                guard glucoseOfLast20Min.first?.date ?? now >= Date().addingTimeInterval(-12.minutes.timeInterval) else {