fix safety carbs sync

This commit is contained in:
Milos Kozak 2021-10-18 21:55:09 +02:00
parent 3f8e56d50e
commit 67c53b412d
2 changed files with 3 additions and 3 deletions

View file

@ -200,11 +200,11 @@ class SafetyPlugin @Inject constructor(
JSONObject() JSONObject()
.putString(R.string.key_age, sp, resourceHelper) .putString(R.string.key_age, sp, resourceHelper)
.putDouble(R.string.key_treatmentssafety_maxbolus, sp, resourceHelper) .putDouble(R.string.key_treatmentssafety_maxbolus, sp, resourceHelper)
.putDouble(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper) .putInt(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper)
override fun applyConfiguration(configuration: JSONObject) { override fun applyConfiguration(configuration: JSONObject) {
configuration.storeString(R.string.key_age, sp, resourceHelper) configuration.storeString(R.string.key_age, sp, resourceHelper)
configuration.storeDouble(R.string.key_treatmentssafety_maxbolus, sp, resourceHelper) configuration.storeDouble(R.string.key_treatmentssafety_maxbolus, sp, resourceHelper)
configuration.storeDouble(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper) configuration.storeInt(R.string.key_treatmentssafety_maxcarbs, sp, resourceHelper)
} }
} }

View file

@ -235,7 +235,7 @@ class SWDefinition @Inject constructor(
.validator { .validator {
sp.contains(R.string.key_age) sp.contains(R.string.key_age)
&& sp.getDouble(R.string.key_treatmentssafety_maxbolus, 0.0) > 0 && sp.getDouble(R.string.key_treatmentssafety_maxbolus, 0.0) > 0
&& sp.getDouble(R.string.key_treatmentssafety_maxcarbs, 0.0) > 0 && sp.getInt(R.string.key_treatmentssafety_maxcarbs, 0) > 0
} }
private val screenInsulin = SWScreen(injector, R.string.configbuilder_insulin) private val screenInsulin = SWScreen(injector, R.string.configbuilder_insulin)
.skippable(false) .skippable(false)