From c931c8d25a59aef28798287c2c690074544231f1 Mon Sep 17 00:00:00 2001 From: Philoul Date: Sun, 7 Mar 2021 10:52:42 +0100 Subject: [PATCH] Careportal Remove Duration ValueWithUnit if empty --- .../java/info/nightscout/androidaps/dialogs/CareDialog.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt index 96bab1b369..7faf59dcca 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt @@ -180,13 +180,13 @@ class CareDialog : DialogFragmentWithDate() { actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_glucosetype) + ": " + translator.translate(type)) actions.add(resourceHelper.gs(R.string.treatments_wizard_bg_label) + ": " + Profile.toCurrentUnitsString(profileFunction, binding.bg.value) + " " + resourceHelper.gs(unitResId)) valuesWithUnit.add(ValueWithUnit(binding.bg.value.toDouble(), profileFunction.getUnits())) - valuesWithUnit.add(ValueWithUnit(type,Units.CPEvent)) + valuesWithUnit.add(ValueWithUnit(type, Units.CPEvent)) json.put("glucose", binding.bg.value) json.put("glucoseType", type) } if (options == EventType.NOTE || options == EventType.EXERCISE) { actions.add(resourceHelper.gs(R.string.careportal_newnstreatment_duration_label) + ": " + resourceHelper.gs(R.string.format_mins, binding.duration.value.toInt())) - valuesWithUnit.add(ValueWithUnit(binding.duration.value.toInt(), Units.M)) + if (!binding.duration.value.equals(0.0)) valuesWithUnit.add(ValueWithUnit(binding.duration.value.toInt(), Units.M)) json.put("duration", binding.duration.value.toInt()) } val notes = binding.notesLayout.notes.text.toString()