Selaa lähdekoodia

ensure that determine basal sync does not get performed twice

polscm32 2 vuotta sitten
vanhempi
commit
de2889bdf4
1 muutettua tiedostoa jossa 6 lisäystä ja 7 poistoa
  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)
             carbsStorage.storeCarbs(carbsToStore)
 
 
-            if skipBolus {
-                apsManager.determineBasalSync()
-                showModal(for: nil)
-            } else if carbs > 0 {
+            if carbs > 0 {
                 saveToCoreData(carbsToStore)
                 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()
+                }
             }
             }
         }
         }