|
@@ -57,6 +57,8 @@ extension AddCarbs {
|
|
|
var firstIndex = true
|
|
var firstIndex = true
|
|
|
// New date for each carb equivalent
|
|
// New date for each carb equivalent
|
|
|
var useDate = date
|
|
var useDate = date
|
|
|
|
|
+ // Group and Identify all FPUs together
|
|
|
|
|
+ let fpuID = UUID().uuidString
|
|
|
|
|
|
|
|
// Loop and save all carb entries
|
|
// Loop and save all carb entries
|
|
|
while carbEquivalents > 0, numberOfEquivalents > 0 {
|
|
while carbEquivalents > 0, numberOfEquivalents > 0 {
|
|
@@ -67,7 +69,7 @@ extension AddCarbs {
|
|
|
carbsStorage.storeCarbs([
|
|
carbsStorage.storeCarbs([
|
|
|
CarbsEntry(
|
|
CarbsEntry(
|
|
|
id: UUID().uuidString, createdAt: useDate, carbs: equivalent,
|
|
id: UUID().uuidString, createdAt: useDate, carbs: equivalent,
|
|
|
- enteredBy: CarbsEntry.manual
|
|
|
|
|
|
|
+ enteredBy: CarbsEntry.manual, isFPU: true, fpuID: fpuID
|
|
|
)
|
|
)
|
|
|
])
|
|
])
|
|
|
numberOfEquivalents -= 1
|
|
numberOfEquivalents -= 1
|
|
@@ -78,7 +80,13 @@ extension AddCarbs {
|
|
|
// Store the real carbs
|
|
// Store the real carbs
|
|
|
if carbs > 0 {
|
|
if carbs > 0 {
|
|
|
carbsStorage
|
|
carbsStorage
|
|
|
- .storeCarbs([CarbsEntry(id: UUID().uuidString, createdAt: date, carbs: carbs, enteredBy: CarbsEntry.manual)])
|
|
|
|
|
|
|
+ .storeCarbs([CarbsEntry(
|
|
|
|
|
+ id: UUID().uuidString,
|
|
|
|
|
+ createdAt: date,
|
|
|
|
|
+ carbs: carbs,
|
|
|
|
|
+ enteredBy: CarbsEntry.manual,
|
|
|
|
|
+ isFPU: false, fpuID: nil
|
|
|
|
|
+ )])
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if settingsManager.settings.skipBolusScreenAfterCarbs {
|
|
if settingsManager.settings.skipBolusScreenAfterCarbs {
|