Merge pull request #1271 from Andries-Smit/fix/treatment-register-carbs

Fix register carbs only treatment dialog
This commit is contained in:
Milos Kozak 2022-02-07 14:58:51 +01:00 committed by GitHub
commit 50d3c4cc91
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -179,9 +179,17 @@ class TreatmentDialog : DialogFragmentWithDate() {
} }
} }
}) })
} else } else {
uel.log(action, Sources.TreatmentDialog, uel.log(action, Sources.TreatmentDialog,
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbs != 0 }) ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 })
if (detailedBolusInfo.carbs > 0) {
disposable += repository.runTransactionForResult(detailedBolusInfo.insertCarbsTransaction())
.subscribe(
{ result -> result.inserted.forEach { aapsLogger.debug(LTag.DATABASE, "Inserted carbs $it") } },
{ aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
)
}
}
} }
}) })
} }