Fix double userEntry with VirtualPump if we enter Carbs + Insulin
This commit is contained in:
parent
baa37c4e3a
commit
4d1f330064
1 changed files with 6 additions and 6 deletions
|
@ -167,18 +167,18 @@ class TreatmentDialog : DialogFragmentWithDate() {
|
||||||
{ aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
{ aapsLogger.error(LTag.DATABASE, "Error while saving carbs", it) }
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
if (detailedBolusInfo.insulin > 0)
|
if (detailedBolusInfo.insulin > 0) {
|
||||||
|
uel.log(action, Sources.TreatmentDialog,
|
||||||
|
ValueWithUnit.Insulin(insulinAfterConstraints),
|
||||||
|
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 })
|
||||||
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
commandQueue.bolus(detailedBolusInfo, object : Callback() {
|
||||||
override fun run() {
|
override fun run() {
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
ErrorHelperActivity.runAlarm(ctx, result.comment, resourceHelper.gs(R.string.treatmentdeliveryerror), info.nightscout.androidaps.dana.R.raw.boluserror)
|
||||||
} else
|
}
|
||||||
uel.log(action, Sources.TreatmentDialog,
|
|
||||||
ValueWithUnit.Insulin(insulinAfterConstraints),
|
|
||||||
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbsAfterConstraints != 0 })
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
else
|
} else
|
||||||
uel.log(action, Sources.TreatmentDialog,
|
uel.log(action, Sources.TreatmentDialog,
|
||||||
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbs != 0 })
|
ValueWithUnit.Gram(carbsAfterConstraints).takeIf { carbs != 0 })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue