浏览代码

ensure that determine basal sync does not get performed twice

polscm32 2 年之前
父节点
当前提交
de2889bdf4
共有 1 个文件被更改,包括 6 次插入7 次删除
  1. 6 7
      FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

+ 6 - 7
FreeAPS/Sources/Modules/Bolus/BolusStateModel.swift

@@ -315,14 +315,13 @@ extension Bolus {
             )]
             carbsStorage.storeCarbs(carbsToStore)
 
-            if skipBolus {
-                apsManager.determineBasalSync()
-                showModal(for: nil)
-            } else if carbs > 0 {
+            if carbs > 0 {
                 saveToCoreData(carbsToStore)
-                apsManager.determineBasalSync()
-            } else {
-                hideModal()
+
+                // only perform determine basal sync if the user doesn't use the pump bolus, otherwise the enact bolus func in the APSManger does a sync
+                if amount == 0 {
+                    apsManager.determineBasalSync()
+                }
             }
         }